-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA. Football.c
53 lines (46 loc) · 990 Bytes
/
A. Football.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char a[101];
int i,j,count,sum;
while(scanf("%s",a)!=EOF)
{
count=0,sum=0;
for(i=0; a[i]!='\0'; i++)
{
if(a[i]==49)
{
count++;
if(count>=7)
{
printf("YES\n");
exit(0);
}
if(a[i-1]==48)
{
sum=0;
}
}
else if(a[i]==48)
{
sum++;
if(sum>=7)
{
printf("YES\n");
exit(0);
}
if(a[i-1]==49)
{
count=0;
}
}
}
if(sum<7 && count<7)
{
printf("NO\n");
}
}
return 0;
}