#include <stdio.h>
#include <math.h>
int main(void){
int a,b,c;
while (scanf("%d %d %d",&a,&b,&c)!=EOF)
{
int D = b*b-4*a*c;
if (D > 0)
printf("Two different roots x1=%d , x2=%d",(-b+sqrt(D))/(2*a),(-b-sqrt(D))/(2*a));
if(D == 0)
printf("Two same roots x=%d",-b/(2*a));
if(D < 0)
printf("No real root");
}
return(0);
}
程式就像上面那樣
但是第一題一直錯
誰能指點我一下
感激