Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
626 B
1
Indexable
Never
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main()
{
	int n, i, s = 0;
	string q = "ABCEHKMOPTXY", num = "1234567890", a;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		s = 0;
		for (int j = 0; j < 6; j++)
		{

			if (j == 0 || j == 4 || j == 5) {
				for (int b = 0; b < q.size(); b++)
				{
					if (a[j] == q[b]) {
						s += 1;
					}
				}
			}
			else {
				for (int b = 0; b < num.size(); b++)
				{
					if (a[j] == num[b]) {
						s += 1;
					}
				}
			}
		}
		if (s == 6) cout << "Yes" << "\n";
		else cout << "No" << "\n";
	}

}