progress
This commit is contained in:
24
programs/a3/main.c
Normal file
24
programs/a3/main.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
double a, b, c, D;
|
||||
|
||||
printf("a: ");
|
||||
scanf("%lf", &a);
|
||||
printf("b: ");
|
||||
scanf("%lf", &b);
|
||||
printf("c: ");
|
||||
scanf("%lf", &c);
|
||||
|
||||
D = b * b - 4 * a * c;
|
||||
|
||||
if (D == 0.0) {
|
||||
puts("Superposition");
|
||||
} else if (D < 0.0) {
|
||||
puts("Two complex answers");
|
||||
} else if (D > 0.0) {
|
||||
puts("Two real answers");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user