scanf输入数值后不运行,什么问题,大神指教
#include<stdio.h>#include<math.h>
int main(void)
{
int a, b, c;
float delta, x1, x2;
delta = float(b*b - (4*a*c));
printf("Please putinto three number:");
scanf("%d%d%d\n", &a, &b, &c);
if(delta>0)
{
x1 = (-b+sqrt(delta))/(2*a);
x2 = (-b-sqrt(delta))/(2*a);
printf("该一元二次方程有两个解,x1 = %f, x2 = %f\n", x1, x2);
}
else if(delta == 0)
{
x1 = (-b)/(2*a);
x2 = x1;
printf("该一元二次方程有一个解, x1 = x2 =%f\n", x1);
}
else
{
printf("该一元二次方程无解\n");
}
return 0;
}