-
Notifications
You must be signed in to change notification settings - Fork 0
/
8- (1).c
47 lines (43 loc) · 874 Bytes
/
8- (1).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
#include<stdio.h>
#define size 7
struct Card
{
int number;
char pattern;
};
int main()
{
struct Card list[size];
int i, j, cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
printf("Ä«µå¸¦ ÀÔ·ÂÇϽÿÀ.");
for (i = 0;i < size;i++)
{
scanf("%d", &list[i].number);
scanf("%s", &list[i].pattern);
}
for (i = 0;i < size;i++)
{
for (j = i+1;j < size;j++)
{
if (list[i].pattern == list[j].pattern && list[i].pattern == 's')
cnt1++;
if (list[i].pattern == list[j].pattern && list[i].pattern == 'd')
cnt2++;
if (list[i].pattern == list[j].pattern && list[i].pattern == 'h')
cnt3++;
if (list[i].pattern == list[j].pattern && list[i].pattern == 'c')
cnt4++;
}
}
if (cnt1 >= 5)
printf("Yes");
else if (cnt2 >= 5)
printf("Yes");
else if (cnt3 >= 5)
printf("Yes");
else if (cnt4 >= 5)
printf("Yes");
else
printf("No");
return 0;
}