会TC的进

来源:百度知道 编辑:UC知道 时间:2024/05/28 02:03:55
这题该怎么做啊?
求一元二次方程的根,用循环方法能实现重复输入系数a,b,c的值。

#include <stdio.h>
#include <math.h>

int main(int argc, char *argv[])
{
int suc=1;
double a, b, c;
while(1)
{
printf("Please entery a b c(输入不是数据则退出)");
suc = scanf("%lf %lf %lf", &a, &b, &c);
if(suc != 3 || !suc) break;
/*
加入你的代码求根
*/
}
return 0;
}