-
Notifications
You must be signed in to change notification settings - Fork 0
/
text.c
48 lines (43 loc) · 864 Bytes
/
text.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
#include<stdio.h>
int main(){
int arr[9],arr2[9],count[9];
int i,found=0,j;
for(i=0;i<9;i++){
scanf("%d",&arr[i]);
}
arr2[found]=arr[0];
count[found]=1;
found++;
for(i=1;i<9;i++){
for(j=0;j<found;j++){
if(arr[i]==arr2[j]){
count[j]++;
break;
}
if(count[j]>3)
{
printf("No");
return 0;
}
}
if(found==j){
arr2[found]=arr[i];
count[found]=1;
found++;
}
if(found>3)
{
printf("No");
return 0;
}
}
for(i=0;i<found;i++){
if(count[i]!=3){
printf("No");
return 0;
}
}
if(i==found){
printf("Yes");
}
}