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