Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- bool check(char in[]){
- for(int i=0;i<=strlen(in);i++){
- if(in[i]=='G' || in[i]=='g'){
- if(in[i+1]=='O' || in[i+1]=='o'){
- if(in[i+2]=='O' || in[i+2]=='o'){
- if(in[i+3]=='D' || in[i+3]=='d'){
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- int main(){
- int tc;
- scanf("%d",&tc);
- for(int i=1;i<=tc;i++){
- char in[100];
- scanf(" %[^\n]",in);
- if(check(in)){
- printf("Case #%d: yes\n", i);
- }else{
- printf("Case #%d: no\n", i);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement