题意是问是否存在7个或以上相同的数字相连
读入从左到右依次遍历计数即可
Code:
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
// http://codeforces.com/contest/96
// Football
int main()
{
string s; cin>>s;
int cnt=1;
for(int i=1;i<s.length();i++)
{
if(s[i]==s[i-1]) cnt++;
else cnt=1;
if(cnt==7) {cout<<"YES";return 0;}
}
cout<<"NO";
return 0;
}