| ||||||||||
| 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 | |||||||||
为什么总是Presentation Error?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator