求大神帮忙

P5730 【深基5.例10】显示屏

Chennnnn1220 @ 2024-06-11 19:49:01

data=['XXX..XXXXXXXX.XXXXXXXXXXXXXXXX', 'X.X..X..X..XX.XX..X....XX.XX.X', 'X.X..XXXXXXXXXXXXXXXX..XXXXXXX', 'X.X..XX....X..X..XX.X..XX.X..X', 'XXX..XXXXXXX..XXXXXXX..XXXXXXX']

n=int(input())

x=input()

nums=list(x)

nums=[int(item) for item in nums]

for i in range(5):

    for index in range(n):

            j=nums[index]*3

            print(data[i][j],data[i][j+1],data[i][j+2],sep='',end='')

            if index<len(nums)-1:

                print('.',end='')

    print('')

|