-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1102.cpp
More file actions
38 lines (38 loc) · 787 Bytes
/
1102.cpp
File metadata and controls
38 lines (38 loc) · 787 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
#include<iostream>
using namespace std;
int main(){
int flag[10][5]={1,3,0,3,1,0,2,0,2,0,1,2,1,1,1,1,2,1,2,1,0,3,1,2,0,1,1,1,2,1,1,1,1,3,1,1,2,0,2,0,1,3,1,3,1,1,3,1,2,1};
int m,i,j,k,t;
char s[10];
cin>>m>>s;
while(m){
for(t=0;t<5;t++){
if(t==0||t==2||t==4){
i=0;
while(s[i]){
cout<<' ';
for(j=0;j<m;j++)if(flag[s[i]-'0'][t]==1)cout<<'-';else cout<<' ';
cout<<' ';
i++;
if(s[i])cout<<' ';
}
cout<<endl;
}else {
for(j=0;j<m;j++){
i=0;
while(s[i]){
if(flag[s[i]-'0'][t]%2==1)cout<<'|';else cout<<' ';
for(k=0;k<m;k++)cout<<' ';
if(flag[s[i]-'0'][t]>>1==1)cout<<'|';else cout<<' ';
i++;
if(s[i])cout<<' ';
}
cout<<endl;
}
}
}
cout<<' '<<endl;
cin>>m>>s;
}
return 0;
}