#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <set>
#include <iostream>
#include <map>
#include <set>
#include <string.h>
using namespace std;
string help(string& s)
{
string tmp = "";
for(int i = 0; i < s.size(); ++i)
{
if(s[i] == '#')
{
if(i == 0)
{
tmp = "";
}else
{
tmp = tmp.substr(0, tmp.size() - 1);
}
}else if(s[i] == '@')
{
tmp = "";
}else
{
tmp += s[i];
}
}
return tmp;
}
int main(int argc,char* argv[])
{
int n;
scanf("%d", &n);
char buf[100];
for(int i = 0; i < n; ++i)
{
memset(buf, 0, 100);
scanf("%s", buf);
string s = buf;
string tmp = help(s);
printf("%s\n", tmp.c_str());
}
return 0;
}
360笔试--行编辑器
最新推荐文章于 2019-09-18 23:39:02 发布