Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

chef and feedback

$
0
0
#include<iostream>
using namespace std;
int main()
{
int t,count,i=0;
char str[100005];
count=0;
cin>>t;
while(t--)
{

    cin>>str;
    while(str[i]!=NULL)
    {
        if((str[i]=='0' && str[i+1]=='1' && str[i+2]=='0') || (str[i]=='1' && str[i+1]=='0' && str[i+2]=='1'))
         {
            count++;
         }i++;
    }
     if(count!=0)
     {
        cout<<"Good"<<endl;
        count=0;
     }  
else cout<<"Bad"<<endl;
}

}

shows wrong answer


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>