#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[101];
int sum1=0,sum0=0;
while(gets(s)){
for(int i=0; i<strlen(s); i++){
if(s[i]=='0'){
sum1=0;
sum0++;
}
else if(s[i]=='1'){
sum0=0;
sum1++;
}
if(sum1>=7 || sum0>=7)
break;
}
if(sum0>=7||sum1>=7)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
sum1=0,sum0=0;
}
return 0;
}
using namespace std;
int main()
{
char s[101];
int sum1=0,sum0=0;
while(gets(s)){
for(int i=0; i<strlen(s); i++){
if(s[i]=='0'){
sum1=0;
sum0++;
}
else if(s[i]=='1'){
sum0=0;
sum1++;
}
if(sum1>=7 || sum0>=7)
break;
}
if(sum0>=7||sum1>=7)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
sum1=0,sum0=0;
}
return 0;
}
No comments:
Post a Comment