给大家推荐个靠谱的公众号程序员探索之路,大家一起加油
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<stack>
using namespace std;
main()
{
char a[100],b[100];
int k,j=0;
stack<char> s;
scanf("%s",a);
k=strlen(a);
for(int i=0;i<k;i++)
{
if(a[i]=='@')
{
while(!s.empty())
{s.pop();}
}
else if(a[i]=='#') s.pop();
else s.push(a[i]);
}
while(!s.empty())
{
b[j]=s.top();
s.pop();
j++;
}
for(int i=j-1;i>=0;i--)
printf("%c",b[i]);
}