解题思路:
注意事项:
参考代码:
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
double a,b,c;
scanf("%lf%lf%lf",&a,&b,&c);
double x1=0.0,x2=0.0;
if(b*b-4*a*c<0)
{
printf("无解!");
}
else
{
x1=(-b+sqrt(b*b-4*a*c))/(2*a);
x2=(-b-sqrt(b*b-4*a*c))/(2*a);
}
printf("%.2f %.2f",x1,x2);
return 0;
}
0.0分
0 人评分
A+B for Input-Output Practice (VII) (C++代码)浏览:615 |
【蟠桃记】 (C语言代码)浏览:669 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:473 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:609 |
循环入门练习6 (C语言代码)浏览:971 |
1071题解浏览:495 |
一元一次方程 (C语言代码)浏览:4075 |
数组输出 (C语言代码)浏览:709 |
判定字符位置 (C语言代码)浏览:801 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:511 |