-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1052.c
69 lines (69 loc) · 1.63 KB
/
1052.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
int main(){
char hand[100][100]={'\0'},eye[100][100]={'\0'},mouth[100][100]={'\0'},ch,ch2;
int counthand=0,counteye=0,countmouth=0,n,i=0,j=0,count[5],out[5]={0},flag=0;
while((ch=getchar())!='\n'){
if(ch=='['){
counthand++;
while((ch2=getchar())!=']'){
hand[i][j]=ch2;
j++;
}
i++;
}
j=0;
}
i=0;
while((ch=getchar())!='\n'){
if(ch=='['){
counteye++;
while((ch2=getchar())!=']'){
eye[i][j]=ch2;
j++;
}
i++;
}
j=0;
}
i=0;
while((ch=getchar())!='\n'){
if(ch=='['){
countmouth++;
while((ch2=getchar())!=']'){
mouth[i][j]=ch2;
j++;
}
i++;
}
j=0;
}
scanf("%d",&n);
count[0]=count[4]=counthand;
count[1]=count[3]=counteye;
count[2]=countmouth;
for(i=0;i<n;i++){
for(j=0;j<5;j++){
scanf("%d",&out[j]);
if(out[j]>count[j]||out[j]<1){
flag=1;
}
}
if(flag==0){
printf("%s(",hand[out[0]-1]);
printf("%s",eye[out[1]-1]);
printf("%s",mouth[out[2]-1]);
printf("%s",eye[out[3]-1]);
printf(")%s\n",hand[out[4]-1]);
}
else{
printf("Are you kidding me? @\\/@\n");
flag=0;
}
memset(out, 0, 5*sizeof(int));
}
return 0;
}