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 |
Re:同样的代码,不同编译器为啥一个AC一个WAIn Reply To:同样的代码,不同编译器为啥一个AC一个WA Posted by:onion001 at 2013-10-12 12:30:04 > #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