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

请问各位大虾,谁能帮我看看是什么问题呀?

Posted by ZYWei at 2008-03-05 18:25:29 on Problem 3510
#include<stdio.h>
int main()
{
	char out[1000000];
	char c;
	int i=0;
	while((c=getchar())!='EOF')
	{
		if(c>='a'&&c<='z'||c==' '||c=='\n'||c=='\t')
		{
			if(c=='i'&&i>1&&out[i-1]=='e')
			{
				if(out[i-2]=='c')
					out[i++]=c;
				else
				{
					out[i-1]='i';
					out[i++]='e';
				}
			}
			else if(c=='d'&&i>0)
			{
				if(out[i-1]=='d')
					out[i-1]='p';
				else
					out[i++]='d';
			}
			else if(c=='k'&&i>2&&out[i-1]=='n'&&out[i-2]=='i'&&out[i-3]=='p')
			{
				out[i+1]='d';
				out[i]='y';
				out[i-1]='o';
				out[i-2]='l';
				out[i-3]='f';
				i=i+2;
			}
			else
				out[i++]=c;
		}
		else
			continue;
	}
	for(int j=0;j<i+1;j++)
		printf("%c",out[j]);
	printf("\n");
	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