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

这题有什么特殊情况吗?测试数据过了但还是wa?

Posted by yulai251752 at 2006-04-01 10:04:31 on Problem 2608
#include<stdio.h>
int main()
{
	int i=0;	char b[1000];char c;
	b[i++]='0';

	while((c=getchar())!=EOF)
	{
		
		
			if(c=='B'||c=='F'||c=='P'||c=='V')
			{
				b[i]='1';
				if(b[i]!=b[i-1])putchar('1');
			}
			if(c=='C'||c=='G'||c=='J'||c=='K'||c=='Q'||c=='S'||c=='X'||c=='Z')
				{
				b[i]='2';
				if(b[i]!=b[i-1])putchar('2');
			}
			if(c=='D'||c=='T')
				{
				b[i]='3';
				if(b[i]!=b[i-1])putchar('3');
			}
		   if(c=='L')
				{
				b[i]='4';
				if(b[i]!=b[i-1])putchar('4');
			}
		   if(c=='M'||c=='N')
				{
				b[i]='5';
				if(b[i]!=b[i-1])putchar('5');
			}
			if(c=='R')
				{
				b[i]='6';
				if(b[i]!=b[i-1])putchar('6');
			}
			if(c=='\n')
				{
				b[i]='\n';
				if(b[i]!=b[i-1])putchar('\n');
			}
			
		i++;
	}
	return 0;
}		

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