解法:
#include<iostream>
#include<stack>
using namespace std;
int main() {stack<char> sk;char c;bool flag = false;while (cin >> c) {if (c == '#') break;if (c == '@') {flag = true;continue;}if (flag) {if (sk.top() == c) {sk.pop();continue;}}sk.push(c);}if (sk.empty()) cout << "yes!";else cout << "no!";return 0;
}