#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <queue>#include <algorithm>#include <stack>using namespace std;char s[1000];int main(){ int n; int xia,gan; cin >> n; getchar(); while(n--) { gets(s); int len = strlen(s); xia = gan = 0; for(int i = 0; i<len; i++) { if(s[i] == '_') xia++; else if(s[i] == '!') gan++; } if(xia>1) printf("Non"); else if(xia == 1 && !gan) printf("Yesn"); else if(xia && gan) printf("Non"); else { int l; char str[20]; if(len%13) { printf("Non"); } else if(len == 13) { if(!strcmp(s,"Hello, world!")) printf("Yesn"); else printf("Non"); } else { int flag = 1; for(int i = 13; i<=len-13; i+=13) { if(s[i] == 'H' && s[i+1] == 'e' && s[i+2] == 'l' && s[i+3] == 'l' && s[i+4] == 'o' && s[i+5] == ',' && s[i+6] == ' ' && s[i+7] == 'w' && s[i+8] == 'o' && s[i+9] == 'r' && s[i+10] == 'l' && s[i+11] == 'd' && s[i+12] == '!') flag == 1; else { flag = 0; break; } } if(flag) printf("Yesn"); else printf("Non"); } } } return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)