Advertisement
Guest User

Футбол

a guest
Jul 8th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. int main()
  5. {
  6.     int sz=0, so=0;
  7.     char ch;
  8.     bool danger=false;
  9.     while((ch=getch())!=13)
  10.         {
  11.             printf("%c", ch);
  12.             if(ch=='0')
  13.             {
  14.                 so=0;
  15.                 sz++;
  16.                 if(sz>=7)
  17.                 {
  18.                     danger=true;
  19.                 }
  20.             }
  21.             if(ch=='1')
  22.             {
  23.                 sz=0;
  24.                 so++;
  25.                 if(so>=7)
  26.                 {
  27.                     danger=true;
  28.                 }
  29.             }
  30.         }
  31.     if((sz>=7)||(so>=7)||(danger==true))
  32.         printf("YES");
  33.     if((sz<7)&&(so<7)&&(danger==false))
  34.         printf("NO");
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement