forked from KinderCareAssessment-G-17/G-17
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathletter Y.c
69 lines (61 loc) · 2.15 KB
/
letter Y.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>
void enter(char y[7][5]){
printf(" _____ _____ _____ _____ _____\n");
printf("| %c | %c | %c | %c | %c |\n",y[0][0],y[0][1],y[0][2],y[0][3],y[0][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",y[1][0],y[1][1],y[1][2],y[1][3],y[1][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",y[2][0],y[2][1],y[2][2],y[2][3],y[2][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",y[3][0],y[3][1],y[3][2],y[3][3],y[3][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",y[4][0],y[4][1],y[4][2],y[4][3],y[4][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",y[5][0],y[5][1],y[5][2],y[5][3],y[5][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",y[6][0],y[6][1],y[6][2],y[6][3],y[6][4]);
printf("|_____|_____|_____|_____|_____|\n");
}
void main(){
char Y[7][5] = {
{'*',' ',' ',' ','*' },
{' ','*',' ','*',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
};
char letter_Y[7][5]={
{'1','0','0','0','1' },
{'0','1','0','1','0' },
{'0','0','1','0','0' },
{'0','0','1','0','0' },
{'0','0','1','0','0' },
{'0','0','1','0','0' },
{'0','0','1','0','0' }
};
char ans[7][5];
int i,j;
for(i = 0; i < 7; i++){
for(j = 0; j < 5; j++){
printf(" %c", Y[i][j]);
}
printf("\n");
}
for(i = 0; i < 7; ++i){
for(j = 0; j < 5; j++){
printf("Enter 0 or 1 at position ans[%d][%d];",i,j);
scanf("%s", &ans[i][j]);
}
}
enter(ans);
int score = 0;
for(i = 0; i < 7; i++){
for(j = 0;j < 5; j++){
if(ans[i][j] == letter_Y[i][j])
score++;
}
}
printf("The final score of the student is: %d", score);
}