Advertisement
DaniDori

ЗАДАЧА №691 Номера автобусов

Apr 13th, 2023
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a;
  8. cin >> a;
  9. string s = "ABCEHKMOPTXY";
  10. //if (s.find('e')!=string::npos)
  11. // cout << "yes";
  12. string c = "";
  13. string y = "1234567890";
  14. for(int i = 0; i < a; i++) {
  15. cin >> c;
  16. if (c.size() == 6)
  17. if (s.find(c[0]) != string::npos and
  18. y.find(c[1]) != string::npos and
  19. y.find(c[2]) != string::npos and
  20. y.find(c[3]) != string::npos and
  21. s.find(c[4]) != string::npos and
  22. s.find(c[5]) != string::npos)
  23. cout << "Yes" << endl;
  24. else
  25. cout << "No" << endl;
  26. else
  27. cout << "No" << endl;
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement