#710: 誰能幫我看一下


ji3gj942l41l4 (請用中文打帳號)


#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);

 

程式就像上面那樣

但是第一題一直錯

誰能指點我一下

感激

 

#716: Re:誰能幫我看一下


summer_time (summer)


俺们学PASCAL的,看不懂C……额……捏哈哈