Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <string.h>
- using namespace std;
- int main()
- {
- int sz=0, so=0, i=0, n=0;
- char a[101];
- bool danger=false;
- cin.getline(a,101);
- n=strlen(a);
- for(i=0; i<=n; i++)
- {
- if(a[i]=='0')
- {
- so=0;
- sz++;
- if(sz>=7)
- {
- danger=true;
- }
- }
- if(a[i]=='1')
- {
- sz=0;
- so++;
- if(so>=7)
- {
- danger=true;
- }
- }
- }
- if((sz>=7)||(so>=7)||(danger==true))
- printf("YES");
- if((sz<7)&&(so<7)&&(danger==false))
- printf("NO");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement