-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2002j1.c
More file actions
44 lines (44 loc) · 999 Bytes
/
2002j1.c
File metadata and controls
44 lines (44 loc) · 999 Bytes
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
#include <stdio.h>
int main(){
int font[10][7]={
{1,1,1,0,1,1,1},
{0,0,1,0,0,1,0},
{1,0,1,1,1,0,1},
{1,0,1,1,0,1,1},
{0,1,1,1,0,1,0},
{1,1,0,1,0,1,1},
{1,1,0,1,1,1,1},
{1,0,1,0,0,1,0},
{1,1,1,1,1,1,1},
{1,1,1,1,0,1,1}
};
int n;
puts("Enter a digit between 0 and 9:");
scanf("%d",&n);
if(font[n][0]==1){
puts(" ***");
}
if((font[n][1]==1)&&(font[n][2]==0)){
puts("*\n*\n*");
}else if((font[n][1]==0)&&(font[n][2]==1)){
puts(" *\n *\n *");
}else{
puts("* *\n* *\n* *");
}
if(font[n][3]==1){
puts(" ***");
}else{
putchar('\n');
}
if((font[n][4]==1)&&(font[n][5]==0)){
puts("*\n*\n*");
}else if((font[n][4]==0)&&(font[n][5]==1)){
puts(" *\n *\n *");
}else{
puts("* *\n* *\n* *");
}
if(font[n][6]==1){
puts(" ***");
}
return 0;
}