#include <bits/stdc++.h>
using namespace std;
int main()
{
stackvis;
stackvis2;
char c;
while(~scanf("%c",&c))
{
while(c!=’\n’&&c!=’\0’)
{
if(c==’#’)
{
if(!vis.empty()) vis.pop();
}
else if(c==’@’) while(!vis.empty()) vis.pop();
else vis.push©;
c=getchar();
}
while(!vis.empty()) vis2.push(vis.top()),vis.pop();
while(!vis2.empty()) printf("%c",vis2.top()),vis2.pop();
cout<<endl;
}
return 0;
}
#include
#include
#include
#include
using namespace std;
int main()
{
stack s1;
stack s2;
char str[110];
gets(str);
int len=strlen(str);
for(int i=0; i<len; i++)
{
if(str[i]’@’)
{
while(!s1.empty()) s1.pop();
continue;
}
if(str[i]’#’)
if(!s1.empty())
{
s1.pop();
continue;
}
s1.push(str[i]);
}
while(!s1.empty()) s2.push(s1.top()),s1.pop();
while(!s2.empty()) printf("%c",s2.top()),s2.pop();
printf("\n");
return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
char s[300];
int main()
{
scanf("%s",s);
int l=strlen(s);
stackq;
char tmp;
for(int i=0; i<l; i++)
{
if(q.empty()) q.push(s[i]);
else
{
tmp=q.top();
if((tmp==’[’&&s[i]’]’)||(tmp’(’&&s[i]==’)’)) q.pop();
else q.push(s[i]);
}
}
if(q.empty()) printf(“OK\n”);
else printf(“Wrong\n”);
return 0;
}
//#include <bits/stdc++.h>
//
//using namespace std;
//
//int main()
//{
// stackvis;
// stackvis2;
// char c;
// while(~scanf("%c",&c))
// {
// c1=1;
// while(c!=’\n’&&c!=’\0’)
// {
// while(!vis.empty()) vis2.push(vis.top()),vis.pop();
// while(!vis2.empty()) printf("%c",vis2.top()),vis2.pop();
// cout<<endl;
// }
// }
// return 0;
//}
//
//
//#include<bits/stdc++.h>
//
//using namespace std;
//
//typedef long long ll;
//
//char s[300];
//
//int main()
//{
// scanf("%s",s);
// int l=strlen(s);
// stackq;
// char tmp;
// for(int i=0; i<l; i++)
// {
// if(q.empty()) q.push(s[i]);
// else
// {
// tmp=q.top();
// if((tmp==’[’&&s[i]’]’)||(tmp’(’&&s[i]==’)’)) q.pop();
// else q.push(s[i]);
// }
// }
// if(q.empty()) printf(“OK\n”);
// else printf(“Wrong\n”);
// return 0;
//}
#include <bits/stdc++.h>
using namespace std;
int main()
{
stackvis;
stackvis2;
char c;
while(~scanf("%c",&c))
{
}
return 0;
}