Saturday, May 21, 2016

CF 96A

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main() {
    int flag, cnt;
    char s[105];
    scanf("%s", s);
    cnt=flag=0;
    for(int i=1; i<strlen(s); i++) {
        if(s[i]==s[i-1]) cnt++;
        else cnt=0;
        if(cnt==6) {
            flag=1;
            printf("YES");
            break;
        }
    }
    if(flag==0) printf("NO");
    return 0;
}

No comments:

Post a Comment

Thank you for commenting. Please wait for response :)