Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int main()
- {
- int sz=0, so=0;
- char ch;
- bool danger=false;
- while((ch=getch())!=13)
- {
- printf("%c", ch);
- if(ch=='0')
- {
- so=0;
- sz++;
- if(sz>=7)
- {
- danger=true;
- }
- }
- if(ch=='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