Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
752 B
1
Indexable
Never
#include <iostream>
#include <cmath>
using namespace std;
int main() {
	int a, c, flag;
	string A = "ABCEHKMOPTXY";
	string A1 = "0123456789";
	flag = 0;
	string b;
	cin >> a;
	for (int i = 0; i < a; i++){
		cin >> b;
		if (b.size() == 6) {
			if (count(A.begin(),A.end(),b[0])) flag+=1;
			if (count(A1.begin(), A1.end(), b[1])) flag += 1;
			if (count(A1.begin(), A1.end(), b[2])) flag += 1;
			if (count(A1.begin(), A1.end(), b[3])) flag += 1;
			if (count(A.begin(), A.end(), b[4])) flag += 1;
			if (count(A.begin(), A.end(), b[5])) flag += 1;
			if (flag == 6) {
				flag = 0;
				cout << "Yes" << endl;
				continue;
			}
			else {
				cout << "No" << endl;
				flag = 0;
			}
		}
		else cout << "No" << endl;
	}
}