Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:同样的代码,不同编译器为啥一个AC一个WA

Posted by JPP at 2013-10-12 18:50:18 on Problem 1326
In 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator