Advertisement
saykotislam

Untitled

Mar 24th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int c=0,f=0;
  7.     char ar[200];
  8.  
  9.     cin>>ar;
  10.  
  11.     int l=strlen(ar);
  12.     int tem=l;
  13.  
  14.     int ct=0;
  15.  
  16.  
  17.  
  18.     while(1){
  19.  
  20.         if(ar[ct]=='1'){
  21.             c++;
  22.         }
  23.         ct++;
  24.  
  25.         if(c>=7){
  26.             f=1;
  27.             break;
  28.         }
  29.  
  30.  
  31.         if(ar[ct]=='0'){
  32.             c=0;
  33.         }
  34.  
  35.  
  36.         if(ct==l){
  37.               //  cout<<"break";
  38.             break;
  39.         }
  40.  
  41.     }
  42.  
  43.  
  44.  while(1){
  45.  
  46.         if(ar[ct]=='0'){
  47.             c++;
  48.         }
  49.         ct++;
  50.  
  51.         if(c>=7){
  52.             f=1;
  53.             break;
  54.         }
  55.  
  56.  
  57.         if(ar[ct]=='1'){
  58.             c=0;
  59.         }
  60.  
  61.  
  62.         if(ct==l){
  63.               //  cout<<"break";
  64.             break;
  65.         }
  66.  
  67.     }
  68.  
  69.     if(f==1){
  70.         cout<<"YES"<<endl;
  71.     }
  72.  
  73.     else cout<<"NO"<<endl;
  74.  
  75.     return 0;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement