Advertisement
Guest User

рунки))

a guest
Mar 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. char x;
  6. int q = 1;
  7. while (cin >> x && q != 6)
  8. {
  9. switch (q)
  10. {
  11. case 1:
  12. if (x >= 'A' && x <= 'Z')
  13. q = 2;
  14. else
  15. q = 6;
  16. break;
  17. case 2:
  18. if (x >= 'a' && x <= 'z')
  19. q = 3;
  20. else
  21. q = 6;
  22. break;
  23. case 3:
  24. if (x >= 'a' && x <= 'z')
  25. q = 4;
  26. else if (x >= 'A' && x <= 'Z')
  27. q = 2;
  28. else
  29. q = 6;
  30. break;
  31. case 4:
  32. if (x >= 'a' && x <= 'z')
  33. q = 5;
  34. else if (x >= 'A' && x <= 'Z')
  35. q = 2;
  36.  
  37. else
  38. q = 6;
  39. break;
  40. case 5:
  41. if (x >= 'A' && x <= 'Z')
  42. q = 2;
  43. else
  44. q = 6;
  45. break;
  46.  
  47. }
  48.  
  49.  
  50. }
  51.  
  52. if (q == 1 || q == 2 || q == 6) cout << "No";
  53. else cout << "Yes";
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement