Advertisement
Zuneve

sga m

Nov 3rd, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int aaa(char s) {
  5. int cnt=0;
  6. string n="ABCEHKMOPTXY";
  7. for (int i = 0; i<12; i++) {
  8. if (char(n[i])==s) {
  9. cnt++;
  10. }
  11. } return cnt==1;
  12. }
  13. int main() {
  14. int n;
  15. cin >> n;
  16. for (int i = 0; i<n; i++) {
  17. string s;
  18. cin >> s;
  19. if (s.size()==6 and s[1]>='0' and s[1]<='9' and aaa(char(s[0]))
  20. and aaa(char(s[4])) and aaa(char(s[5])) and s[2]>='0'
  21. and s[2]<='9' and s[3]>='0' and s[3]<='9') cout << "Yes" << endl;
  22. else cout << "No" << endl;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement