forked from KinderCareAssessment-G-17/G-17
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathletter T.c
68 lines (61 loc) · 2.15 KB
/
letter T.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
#include<stdio.h>
void enter(char t[7][5]){
printf(" _____ _____ _____ _____ _____\n");
printf("| %c | %c | %c | %c | %c |\n",t[0][0],t[0][1],t[0][2],t[0][3],t[0][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",t[1][0],t[1][1],t[1][2],t[1][3],t[1][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",t[2][0],t[2][1],t[2][2],t[2][3],t[2][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",t[3][0],t[3][1],t[3][2],t[3][3],t[3][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",t[4][0],t[4][1],t[4][2],t[4][3],t[4][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",t[5][0],t[5][1],t[5][2],t[5][3],t[5][4]);
printf("|_____|_____|_____|_____|_____|\n");
printf("| %c | %c | %c | %c | %c |\n",t[6][0],t[6][1],t[6][2],t[6][3],t[6][4]);
printf("|_____|_____|_____|_____|_____|\n");
}
void main(){
char T[7][5] = {
{'*','*','*','*','*' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
{' ',' ','*',' ',' ' },
};
char letter_T[7][5]={
{'1','1','1','1','1' },
{'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' },
{'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", T[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_T[i][j])
score++;
}
}
printf("The final score of the student is: %d", score);
}