Advertisement
MyOnAsSalat

Untitled

Mar 31st, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.         string s = Console.ReadLine();
  8.         string[] t1 = s.Split('0');
  9.         string[] t2 = s.Split('1');
  10.  
  11.         for (int i = 0; i < t1.Length; i++)
  12.         {
  13.            if (t1[i].Length >= 7)
  14.             {
  15.                 Console.WriteLine("YES");
  16.                 return;
  17.             }
  18.         }
  19.         for (int i = 0; i < t2.Length; i++)
  20.         {
  21.             if (t2[i].Length >= 7)
  22.             {
  23.                 Console.WriteLine("YES");
  24.                 return;
  25.             }
  26.         }
  27.         Console.WriteLine("NO");
  28.        
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement