Aleksandr_Grigoryev

Мура 2

Feb 14th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int m[4][2] = { { 0,1 },{ 2,1 },{ 2,3 },{3,3} };
  6.     char c[50];
  7.     for (int i = 0; i<4; i++)
  8.     {
  9.         cin >> c;
  10.         int k = strlen(c);
  11.         int q = 0;
  12.         for (int j = 0; (j<k); j++)
  13.         {
  14.             int x = c[j] - '0';
  15.             cout << x << endl;
  16.             q = m[q][x];
  17.             cout << q << endl;
  18.         }
  19.         if (q == 2||q==0 ||q==1)
  20.             cout << "YES!!11!" << endl;
  21.         else cout << "error";
  22.     }
  23.     system("pause");
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment