-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathERROR.c
More file actions
30 lines (30 loc) · 667 Bytes
/
Copy pathERROR.c
File metadata and controls
30 lines (30 loc) · 667 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
#include<stdio.h>
#include<string.h>
int main(){
int t;
char s[100000];
scanf("%d",&t);
for(int i=0;i<t;i++){
scanf("%s",&s);
int l=strlen(s);
if(l<3){
printf("Bad\n");
}
else{
int flag=0;
for(int j=0;j<l-2;j++){
if((s[j]=='1' && s[j+1]=='0' && s[j+2]=='1')||(s[j]=='0' && s[j+1]=='1' && s[j+2]=='0')){
flag=1;
break;
}
}
if(flag==1){
printf("Good\n");
}
else{
printf("Bad\n");
}
}
}
return 0;
}