唬人题,其实很水。。处理下两种字符就可以了,其他的全不用管
#include<iostream>
#include<string>
using namespace std;
int main()
{
int T;
cin >> T >> ws;
string s;
while (T--)
{
getline(cin, s);
string res;
for (size_t i = 0; i < s.size(); i++)
if (s[i] == '_')
res += s;
else if (s[i] == '!')
res += "Hello, world!";
cout << (res == s ? "Yes" : "No") << endl;
}
return 0;
}