#include<cstdio> #include<cstring> #include<list> using namespace std; int main() { char s[100001]; while (gets(s)) { list <char> l; list <char> ::iterator it=l.begin(); int len=strlen(s); for (int i=0;i<len;i++) { if (s[i]=='[') it =l.begin(); else if (s[i]==']') it =l.end(); else l.insert(it,s[i]); } for (it=l.begin();it!=l.end();it++) printf("%c",*it); printf("\n"); } return 0; }
Saturday, August 6, 2016
UVA 11988 - Broken Keyboard Solution
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment