题解 | 好串
好串
https://www.nowcoder.com/practice/9b072237ebdd4dd99562f01cbf594fac
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
size_t pos = 0;
while (!s.empty()) {
if ((pos = s.find("ab")) != string::npos) {
s.erase(pos, 2);
} else {
cout << "Bad" << endl;
break;
}
}
if (s.empty())
cout << "Good" << endl;
}
// 64 位输出请用 printf("%lld")


