Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int m[4][2] = { { 0,1 },{ 2,1 },{ 2,3 },{3,3} };
- char c[50];
- for (int i = 0; i<4; i++)
- {
- cin >> c;
- int k = strlen(c);
- int q = 0;
- for (int j = 0; (j<k); j++)
- {
- int x = c[j] - '0';
- cout << x << endl;
- q = m[q][x];
- cout << q << endl;
- }
- if (q == 2||q==0 ||q==1)
- cout << "YES!!11!" << endl;
- else cout << "error";
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment