|
|
back to boardADMINS!WHY WA#1??? Posted by 123 29 May 2010 23:23 #include<stdio.h> #include<iostream> using namespace std; char s[10001],str[80]; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout); #endif int j = 0; memset(s,'\0',sizeof(s)); while(gets(s)) { int len = strlen(s); int i = 0; while(i<len) { if(s[i]=='>') { j++; if(j>79)j=0; } else if(s[i]=='<') { j--; if(j<=0)j=0; } else if(s[i]!='\n' && s[i]!='\0') { str[j] = s[i]; j++; } i++; } memset(s,'\0',sizeof(s)); } for(int i = 0;i<80;i++) printf("%c",str[i]); return 0; } Re: ADMINS!WHY WA#1??? "at the beginning the e-screen contains 80 spaces" Re: ADMINS!WHY WA#1??? Posted by 123 29 May 2010 23:44 I add in begin memset(str,' ',sizeof(80)); I get WA#1 to former =( Re: ADMINS!WHY WA#1??? Thank you!!!You help me!!!I got AC!!!=) |
|
|