python3样例都过了但全wa

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

Margina1 @ 2023-05-14 17:05:53

..X...X.X.X.XXX...X.X.X ..X...X.X.X.X.....X.X.X ..X...X.XXX.XXX...X.XXX ..X...X...X...X...X...X ..X...X...X.XXX...X...X 这是标准答案114516输出

..X...X.X.X.XXX...X.X.X ..X...X.X.X.X.....X.X.X ..X...X.XXX.XXX...X.XXX ..X...X...X...X...X...X ..X...X...X.XXX...X...X 这个是我程序跑出来的结果


by Margina1 @ 2023-05-14 17:06:09

n = eval(input()) a = [["XXX","X.X","X.X","X.X","XXX"], ["..X","..X","..X","..X","..X"], ["XXX","..X","XXX","X..","XXX"], ["XXX","..X","XXX","..X","XXX"], ["X.X","X.X","XXX","..X","..X"], ["XXX","X..","XXX","..X","XXX"], ["XXX","X..","XXX","X.X","XXX"], ["XXX","..X","..X","..X","..X"], ["XXX",'X.X',"XXX","X.X","XXX"], ["XXX","X.X","XXX","..X","XXX"]] b = input() for i in range(5): for j in range(len(b)): if j == len(b)-1: if b[j] == '0': print(a[0][i], end='') elif b[j] == '1': print(a[1][i], end='') elif b[j] == '2': print(a[2][i], end='') elif b[j] == '3': print(a[3][i], end='') elif b[j] == '4': print(a[4][i], end='') elif b[j] == '5': print(a[5][i], end='') elif b[j] == '6': print(a[6][i], end='') elif b[j] == '7': print(a[7][i], end='') elif b[j] == '8': print(a[8][i], end='') elif b[j] == '9': print(a[9][i], end='') else: if b[j] == '0': print(a[0][i],end='.') elif b[j] == '1': print(a[1][i], end='.') elif b[j] == '2': print(a[2][i], end='.') elif b[j] == '3': print(a[3][i], end='.') elif b[j] == '4': print(a[4][i], end='.') elif b[j] == '5': print(a[5][i], end='.') elif b[j] == '6': print(a[6][i], end='.') elif b[j] == '7': print(a[7][i], end='.') elif b[j] == '8': print(a[8][i], end='.') elif b[j] == '9': print(a[9][i], end='.') print()


by rnf5114 @ 2023-05-14 17:28:01

@Margina1 你这代码……


by Margina1 @ 2023-05-14 17:37:23

@liyong5114 我就多判断了一个是否是最后一个数字,不然就不加最后的.了


|