Advertisement
Guest User

Футбол 2

a guest
Jul 8th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int sz=0, so=0, i=0, n=0;
  9.     char a[101];
  10.     bool danger=false;
  11.     cin.getline(a,101);
  12.     n=strlen(a);
  13.     for(i=0; i<=n; i++)
  14.     {
  15.         if(a[i]=='0')
  16.         {
  17.             so=0;
  18.             sz++;
  19.             if(sz>=7)
  20.             {
  21.                 danger=true;
  22.             }
  23.         }
  24.         if(a[i]=='1')
  25.         {
  26.             sz=0;
  27.             so++;
  28.             if(so>=7)
  29.             {
  30.                 danger=true;
  31.             }
  32.         }
  33.     }
  34.     if((sz>=7)||(so>=7)||(danger==true))
  35.         printf("YES");
  36.     if((sz<7)&&(so<7)&&(danger==false))
  37.         printf("NO");
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement