|
|
back to boardWhy WA2??? #include<stdio.h> #include<iostream> using namespace std; char str[300],text[3000005],c,ch; int n=-1,i=0,cnt=-1; int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif while(scanf("%c",&c)!=EOF) { n++; text[n] = c;
} while(i<n) { memset(str,'\0',sizeof(str)); cnt= -1; while(1) { if((text[i]>='a'&&text[i]<='z')||(text[i]>='A'&&text[i]<='Z')) { cnt++; str[cnt] = text[i]; i++; } else { ch = text[i]; i++; break; } } for(int j=cnt;j>=0;j--) { printf("%c",str[j]); } printf("%c",ch); } return 0; } Re: Why WA2??? i WA#2,too. what's the test? Edited by author 04.01.2010 10:42 |
|
|