MohamedAbdel3al

Good or Bad

Aug 6th, 2021
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <bits/stdc++.h>
  4. using namespace std ;
  5. typedef long long ll ;
  6.  
  7. int main() {
  8. ios_base::sync_with_stdio(false) , cin.tie(nullptr) , cout.tie(nullptr) ;
  9. int t ;
  10. string s ;
  11. cin >> t ;
  12. while (t--) {
  13. cin >> s ;
  14. for (int i = 0; i < s.size(); i++) {
  15. if (s[i] != s[i + 1] && s[i] == s[i + 2]) {
  16. cout << "Good" << "\n" ; break ;
  17. } else {
  18. cout << "Bad" << "\n" ;
  19. break ;
  20. }
  21. }
  22. }
  23.  
  24.  
  25. return 0 ;
  26. }
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment