Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int t;
- cin >> t;
- while (t--)
- {
- string s;
- cin >> s;
- bool check = 0;
- for (int i = 0; i < s.size() - 3; i++)
- {
- string x;
- x = s.substr(i, 3);
- if (x == "010" || x == "101")
- check = 1;
- else
- {
- check = 0;
- break;
- }
- }
- if (check)
- cout << "Good" << nl;
- else
- cout << "Bad" << nl;
- }
- int t;
- cin >> t;
- while(t--)
- {
- string s;
- cin >> s;
- bool check = true;
- for (int i = 0; i < s.size()-1;i++)
- {
- if(s[i]==s[i+1])
- {
- cout << "Bad"<<nl;
- check = false;
- break;
- }
- }
- if(check)
- cout << "Good" << nl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement