| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
同样的代码,不同编译器为啥一个AC一个WA#include<stdio.h>
int main(void)
{
char a[5000],b[5000],e[1];
int c,sum=0;
while (0==0)
{
scanf("%s",a);
if (a[0]=='0')
{
printf("%d\n",sum);
sum=0;
continue;
}
if (a[0]=='#') break;
scanf("%s %d %s",b,&c,e);
if (e[0]=='F') sum=sum+c*2;
if (e[0]=='B') sum=sum+c+(c+1)/2;
if ((e[0]=='Y')&&(c<=500)) sum=sum+500;
else if((e[0]=='Y')&&(c>500)) sum=sum+c;
}
return 0;
}
GCC是AC C和C++是WA,求解
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator