Untitled
unknown
c_cpp
2 years ago
733 B
7
Indexable
#include <iostream>
#include <string>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
int a, c = 0;
cin >> a;
string n;
string b = "ABCEHKMOPTXY";
string m = "1234567890";
for (int i = 0; i < a; i++) {
cin >> n;
if (n.size() == 6) {
c++;
}
for (int j = 0; j < b.size(); j++) {
if (n[0] == b[j]) {
c++;
}
if (n[4] == b[j]) {
c++;
}
if (n[5] == b[j]) {
c++;
}
}
for (int g = 0; g < m.size(); g++) {
if (n[1] == m[g]) {
c++;
}
if (n[2] == m[g]) {
c++;
}
if (n[3] == m[g]) {
c++;
}
}
if (c == 7) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
c = 0;
}
}Editor is loading...
Leave a Comment