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