#9461: 過不了的原因?


Joel0829 (可以ㄩ一波)


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main() 
{
double a,b,c,d,e,f,g;
while(scanf("%lf",&a)!=EOF)
{
 b=a*100;
 c=round(b);
 g=c/100;
 if(g==0)
 printf("%0.2lf\n",0.00);
 else if(g==0.50)
 printf("%0.2lf\n",0.49);
 else
 printf("%0.2lf\n",g);
}
return 0;
}
 
 
 
 
 
幫幫我