|
|
back to boardWhy I got WA!! Test #1 Posted by Varoon 15 Mar 2008 20:48 #include<stdio.h> char in[1000]; int l,a; int main() { gets(in); for(l=0;in[l]!=NULL;l++) { if(in[l]>=65&&in[l]<=90) { if(a==0) { printf("%c",in[l]); a=1; } else { printf("%c",in[l]+32); } } else { if(in[l]==32) { printf(" "); } else { if(in[l]=='.'||in[l]=='!'||in[l]=='?') { printf("%c",in[l]); a=0; } else { printf("%c",in[l]); a=1; } } } } return 0; } Edited by author 15.03.2008 20:49 Edited by author 15.03.2008 20:54 |
|
|