Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int T, i, j, mis;
- char inp[6], stan[3][6] = {{111,110,101,0,0,0},
- {116,119,111,0,0,0},
- {116,104,114,101,101,0}};
- cin >> T;
- while (T--)
- {
- cin >> inp;
- for (i = 0; i < 3 ; i++)
- {
- for (j = 0, mis = 0; inp[j] != 0 ; j++)
- {
- if (inp[j] != stan[i][j])
- mis++;
- if (mis == 2)
- break;
- }
- if (inp[j] == 0)
- break;
- }
- if ((i < 3) && (stan[i][j] == 0))
- cout << i+1 << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement