-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathERROR.cpp
More file actions
40 lines (29 loc) · 669 Bytes
/
Copy pathERROR.cpp
File metadata and controls
40 lines (29 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
using namespace std;
int main(){
int t;
cin>>t;
string str;
char *s;
while (t--) {
cin>>str;
int i=0;
if(str.length()<3){
cout<<"Bad"<<endl;
continue;
}
while((i+2)<str.length()){
if(str[i]=='0' && str[i+1]=='1' && str[i+2]=='0'){
cout<<"Good"<<endl;
break;
}else if(str[i]=='1' && str[i+1]=='0' && str[i+2]=='1'){
cout<<"Good"<<endl;
break;
}
i++;
}
if(i+2==str.length())
cout<<"Bad"<<endl;
}
return 0;
}