|
|
back to boardTest #2 Posted by prtest 6 Mar 2008 19:49 Why I got WA? #include<iostream> using namespace std; int main() { int newsen=1,i,l; char str[99999]; while(cin.getline(str,255)) { l=strlen(str); for(i=0;i<l;i++) { if(str[i]<=64 || str[i]>=91) { if(str[i]!='!' && str[i]!='?' && str[i]!=':' && str[i]!=',' && str[i]!='-' && str[i]!='.' && str[i]!=' ') continue; cout<<str[i]; if(str[i]=='.' || str[i]=='?' || str[i]=='!') newsen=1; continue; } if(newsen==1) { cout<<str[i]; newsen=0; }else cout<<(char)(str[i]+32); } cout<<endl; } //system("pause"); return 0; } |
|
|