|
|
вернуться в форумWhy WA // E-screen #include <iostream.h> char screen[80]; int cur=0; void emulate() { char c; while (cin.get(c)) { if (c=='<' && cur>0) cur--; else if (c=='>') { if (cur<79) cur++; else cur=0; } else if (c!='\n' && c!='>' && c!='<') { screen[cur]=c; if (cur<79) cur++; else cur=0; } } for (cur=0; cur<80; cur++) if (screen[cur]!=NULL) cout << screen[cur]; cout << '\n'; } int main() { emulate(); return 0; } |
|
|