#include <stdio.h>
#include <math.h>
int main(void)
{
int a,b,c;
int sum;
while(scanf("%d %d %d",&a,&b,&c)!=EOF)
{
sum = (b * b) - (4 * a * c);
if( sum > 0 )
{
sum = (int)sqrt(sum);
printf("Two different roots x1=%d , x2=%d\n", (-b+sum)/(2*a),(-b-sum)/(2*a) );
}
else if(sum == 0)
printf("Two same roots x=%d\n",(-b)/(2*a));
else
printf("No real root\n");
}
return 0;
}
沒有留言:
張貼留言