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

为什么总是Presentation Error?

Posted by wangxustf at 2011-05-10 22:33:26 on Problem 1951
#include <iostream>
#include <string>
using namespace std;

int main()
{
	char check[30]="AEIOU",input[100];
	int j = 5,i = 0,len;
	bool fst=true;
	cin.getline(input,100);
	while(input[i] == ' ')
		i++;
	len = strlen(input);
	for(;i < len;i++)
	{
		if(strchr(check,input[i]) == 0)
		{
			if(input[i] == ' ')
			{
				fst = false;
			}
			else if(input[i]!='.'&&input[i]!=','&&input[i]!='?'&&fst==false)
			{ 
				printf(" %c",input[i]);
				check[j++]=input[i];
				fst=true;
			}
			else if (input[i]!='.'&&input[i]!=','&&input[i]!='?')
			{
				printf("%c",input[i]);
				check[j++]=input[i];
			}
			else
			{
				printf("%c",input[i]);
			}
		}
	}
	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