|
|
back to boardWhy WA on test 21? #include<iostream> #include<cstring> using namespace std; char a[10000][10000]; int main() { long n=0,i,j; bool b=true; while(cin.getline(*&a[n],10000,'\n')) n++; for(i=0;i<n;i++) { for(j=0;j<strlen(a[i]);j++) { if(a[i][j]=='!' || a[i][j]=='?' || a[i][j]=='.') { b=true; continue; } if(b && a[i][j]!=' ') { b=false; continue; } if(!b) { if(a[i][j]!=' ' && a[i][j]!=',' && a[i][j]!='-' && a[i][j]!=';' && a[i][j]!=':' && ((int)a[i][j]<=(int)'a' || (int)'z'<=(int)a[i][j])) a[i][j]=(char)((int)a[i][j]+((int)'a'-(int)'A')); } } } for(i=0;i<n;i++) cout<<a[i]<<endl; return 0; } |
|
|