Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int aaa(char s) {
- int cnt=0;
- string n="ABCEHKMOPTXY";
- for (int i = 0; i<12; i++) {
- if (char(n[i])==s) {
- cnt++;
- }
- } return cnt==1;
- }
- int main() {
- int n;
- cin >> n;
- for (int i = 0; i<n; i++) {
- string s;
- cin >> s;
- if (s.size()==6 and s[1]>='0' and s[1]<='9' and aaa(char(s[0]))
- and aaa(char(s[4])) and aaa(char(s[5])) and s[2]>='0'
- and s[2]<='9' and s[3]>='0' and s[3]<='9') cout << "Yes" << endl;
- else cout << "No" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement