Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include <iostream>
- #include <vector>
- #include <string>
- #include <fstream>
- #include <cmath>
- using namespace std;
- bool check(char s){
- return s=='A' || s=='B' || s=='C' || s=='E'|| s=='H'||s=='K'||s=='M'||s=='O'||s=='P'||s=='T'||s=='X'||s=='Y';
- }
- bool chec(char s){
- return s>='0'&&s<='9';
- }
- int main(){
- ifstream cin("input.txt");
- ofstream cout("output.txt");
- string s;
- int n;
- cin>>n;
- getline(cin,s);
- for (int i=0;i<n;i++){
- getline(cin,s);
- if (s.length()==6&&check(s[0])&&check(s[4])&&check(s[5])&&chec(s[1])&&chec(s[2])&&chec(s[3]))
- cout<<"Yes"<<'\n';
- else
- cout<<"No"<<'\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement