问题描述
ACM 小组接受了计算机组成原理教研室的一项开发任务,要为计算机组成原理课程开发一款实验面板仿真系统,其中有一项数字显示屏的任务分配给了你。数字显示屏是由一组数字显示单元组成的,每个数字显示单元由七个液晶显示管组成,如下所示:
- | | - | | -
你的任务是将输入数字用数字显示屏的样子仿真输出。
输入格式
第一行为计算用例个数K
第 2 到 K + 1 行每行为一个整数 x
0 ≤ x ≤ 999999999
输出格式
对每个整数 x,输出 x 在数字显示屏上的对应显示。
输入样例
1
123456789
输出样例
- - - - - - -
| | || || | || || |
- - - - - - -
|| | | || | || | |
- - - - - -
代码
N=int(input())
for i in range(N):
X=str(input())
for i in X:
if int(i)==1:
print(' ',' ',' ',sep='',end='')
elif int(i)==2:
print(' ','-',' ',sep='',end='')
elif int(i)==3:
print(' ','-',' ',sep='',end='')
elif int(i)==4:
print(' ',' ',' ',sep='',end='')
elif int(i)==5:
print(' ','-',' ',sep='',end='')
elif int(i)==6:
print(' ','-',' ',sep='',end='')
elif int(i)==7:
print(' ','-',' ',sep='',end='')
elif int(i)==8:
print(' ','-',' ',sep='',end='')
elif int(i)==9:
print(' ','-',' ',sep='',end='')
elif int(i)==0:
print(' ','-',' ',sep='',end='')
print('')
for i in X:
if int(i)==1:
print(' ',' ','|',sep='',end='')
elif int(i)==2:
print(' ',' ','|',sep='',end='')
elif int(i)==3:
print(' ',' ','|',sep='',end='')
elif int(i)==4:
print('|',' ','|',sep='',end='')
elif int(i)==5:
print('|',' ',' ',sep='',end='')
elif int(i)==6:
print('|',' ',' ',sep='',end='')
elif int(i)==7:
print(' ',' ','|',sep='',end='')
elif int(i)==8:
print('|',' ','|',sep='',end='')
elif int(i)==9:
print('|',' ','|',sep='',end='')
elif int(i)==0:
print('|',' ','|',sep='',end='')
print('')
for i in X:
if int(i)==1:
print(' ',' ',' ',sep='',end='')
elif int(i)==2:
print(' ','-',' ',sep='',end='')
elif int(i)==3:
print(' ','-',' ',sep='',end='')
elif int(i)==4:
print(' ','-',' ',sep='',end='')
elif int(i)==5:
print(' ','-',' ',sep='',end='')
elif int(i)==6:
print(' ','-',' ',sep='',end='')
elif int(i)==7:
print(' ',' ',' ',sep='',end='')
elif int(i)==8:
print(' ','-',' ',sep='',end='')
elif int(i)==9:
print(' ','-',' ',sep='',end='')
elif int(i)==0:
print(' ',' ',' ',sep='',end='')
print('')
for i in X:
if int(i)==1:
print(' ',' ','|',sep='',end='')
elif int(i)==2:
print('|',' ',' ',sep='',end='')
elif int(i)==3:
print(' ',' ','|',sep='',end='')
elif int(i)==4:
print(' ',' ','|',sep='',end='')
elif int(i)==5:
print(' ',' ','|',sep='',end='')
elif int(i)==6:
print('|',' ','|',sep='',end='')
elif int(i)==7:
print(' ',' ','|',sep='',end='')
elif int(i)==8:
print('|',' ','|',sep='',end='')
elif int(i)==9:
print(' ',' ','|',sep='',end='')
elif int(i)==0:
print('|',' ','|',sep='',end='')
print('')
for i in X:
if int(i)==1:
print(' ',' ',' ',sep='',end='')
elif int(i)==2:
print(' ','-',' ',sep='',end='')
elif int(i)==3:
print(' ','-',' ',sep='',end='')
elif int(i)==4:
print(' ',' ',' ',sep='',end='')
elif int(i)==5:
print(' ','-',' ',sep='',end='')
elif int(i)==6:
print(' ','-',' ',sep='',end='')
elif int(i)==7:
print(' ',' ',' ',sep='',end='')
elif int(i)==8:
print(' ','-',' ',sep='',end='')
elif int(i)==9:
print(' ','-',' ',sep='',end='')
elif int(i)==0:
print(' ','-',' ',sep='',end='')
print('')