Skip to content

Commit

Permalink
BHASKARA Resolvido
Browse files Browse the repository at this point in the history
Código resolvido com muito ódio.
  • Loading branch information
Patick-gu authored Oct 6, 2023
1 parent 3b15bd7 commit c341072
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions baskhara.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;

int main(){
double A;
double B;
double C;
double A,B,C;
cin>>A>>B>>C;
double regra1= B*B;
double regra2= A*C;
double regra3= regra2 * 4;
double delta= regra1-regra3;
double delta= (B*B)-(4*(A*C));
double raiz = sqrt(delta);
double div= 2*A;
double tratamento = -(B);
double div1= raiz/div;
double resultado1 = tratamento-div1;
double resultado2 = tratamento+div1;
cout<<"delta igual a = "<<delta<<endl;
cout<<"raiz= "<<raiz<<endl;
cout<<"div= "<<div<<endl;
cout<<"tratamento= "<<tratamento<<endl;
cout<<"div1= "<<div1<<endl;
cout<<"R2= "<<resultado1<<endl;
cout<<"R2= "<<resultado2<<endl;
}


if(delta<0){
cout << "impossível calcular " << endl;
}
else if(A==0){
cout << "impossível calcular " << endl;
}
else{
double BHASKARA2=(-(B)-raiz)/div;
double BHASKARA1=(-(B)+raiz)/div;
cout<<fixed<<setprecision(5)<<endl;
cout<<"R1= "<<BHASKARA1<<endl;
cout<<"R2= "<<BHASKARA2<<endl;
}
}

0 comments on commit c341072

Please sign in to comment.