Skip to content

Commit

Permalink
Solução em C
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoamorim-dev authored Sep 10, 2022
1 parent bf6fed3 commit d74b80f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Iniciante/URI 1036.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <stdio.h>
#include <math.h>


int main (){


double a, b, c, x1, x2;
double delta;

scanf("%lf%lf%lf", &a, &b, &c);

delta = b * b - 4 * a * c;

if (a == 0){

printf("Impossivel calcular\n");

}

else{

if (delta > 0){

x1 = (-b + pow(delta,0.5))/(2*a);
x2 = (-b - pow(delta,0.5))/(2*a);
printf("R1 = %.5lf\n", x1);
printf("R2 = %.5lf\n", x2);
}

else{

printf("Impossivel calcular\n");


}
}
}

0 comments on commit d74b80f

Please sign in to comment.