Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. //#include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <fstream>
  5. #include <cmath>
  6. using namespace std;
  7. bool check(char s){
  8. 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';
  9. }
  10. bool chec(char s){
  11. return s>='0'&&s<='9';
  12. }
  13. int main(){
  14. ifstream cin("input.txt");
  15. ofstream cout("output.txt");
  16. string s;
  17. int n;
  18. cin>>n;
  19. getline(cin,s);
  20. for (int i=0;i<n;i++){
  21. getline(cin,s);
  22. if (s.length()==6&&check(s[0])&&check(s[4])&&check(s[5])&&chec(s[1])&&chec(s[2])&&chec(s[3]))
  23. cout<<"Yes"<<'\n';
  24. else
  25. cout<<"No"<<'\n';
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement