Untitled
unknown
c_cpp
a year ago
733 B
5
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