Python RE

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

SakuraTao @ 2021-01-06 20:24:16

num = [
['XXX','..X','XXX','XXX','X.X','XXX','XXX','XXX','XXX','XXX'],
['X.X','..X','..X','..X','X.X','X..','X..','..X','X.X','X.X'],
['X.X','..X','XXX','XXX','XXX','XXX','XXX','..X','XXX','XXX'],
['X.X','..X','X..','..X','..X','..X','X.X','..X','X.X','..X'],
['XXX','..X','XXX','XXX','..X','XXX','XXX','..X','X.X','XXX']]
n = int(input())
s = input()
s = list(s)
s = [int(i) for i in s]
for i in range(5):
    for j in range(len(s)):
        print(num[i][s[j]],end='')
        if j<len(s)-1:
            print('.',end='')
    print()

by justinjia @ 2021-02-04 14:23:18

@SakuraTao 没人回复你的原因:你用的是Python,建议改学C++


by SakuraTao @ 2021-02-04 18:50:17

过了

num = [
['XXX','..X','XXX','XXX','X.X','XXX','XXX','XXX','XXX','XXX'],
['X.X','..X','..X','..X','X.X','X..','X..','..X','X.X','X.X'],
['X.X','..X','XXX','XXX','XXX','XXX','XXX','..X','XXX','XXX'],
['X.X','..X','X..','..X','..X','..X','X.X','..X','X.X','..X'],
['XXX','..X','XXX','XXX','..X','XXX','XXX','..X','XXX','XXX']]
n = int(input().strip())

s = input().strip()

'''
if len(s) > n: 
    sys.exit()
'''
s = list(s)
s = [int(i) for i in s]
for i in range(5):
    for j in range(len(s)):
        print(num[i][s[j]],end='')
        if j<len(s)-1:
            print('.',end='')
    print()

by Samuel233 @ 2021-04-22 16:32:16

没有strip()


|