1 条题解
-
0
#include <stdio.h> #include <math.h>
int main() { double a, b, c; scanf("%lf %lf %lf", &a, &b, &c);
double delta = b * b - 4 * a * c; double x1 = (-b + sqrt(delta)) / (2 * a); double x2 = (-b - sqrt(delta)) / (2 * a); // 保证 x1 >= x2 if (x1 < x2) { double temp = x1; x1 = x2; x2 = temp; } printf("%.2f %.2f\n", x1, x2); return 0;}
信息
- ID
- 260
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 8
- 标签
- 递交数
- 1600
- 已通过
- 245
- 上传者