mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-03 17:26:21 +00:00
28 lines
467 B
C
28 lines
467 B
C
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
double a, b, c;
|
||
|
|
||
|
scanf("%lf%lf%lf", &a, &b, &c);
|
||
|
|
||
|
if (a == 0) {
|
||
|
if (b == 0 && c != 0) {
|
||
|
printf("0\n");
|
||
|
} else {
|
||
|
printf("1\n");
|
||
|
}
|
||
|
} else {
|
||
|
double delta = b * b - 4 * a * c;
|
||
|
|
||
|
if (delta > 0) {
|
||
|
printf("2\n");
|
||
|
} else if (delta == 0) {
|
||
|
printf("1\n");
|
||
|
} else {
|
||
|
printf("0\n");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|