DownLoads @ 2020-12-26 10:09:16
帮同学改的程序 @little_blue
原本自己早已经AC了,但现在越改越懵
n = int(input())
an = input()
f = 0
s1,s2,s3,s4,s5 = "","","","",""
for i in an:
if i == "0":
s1 += "XXX"
s2 += "X.X"
s3 += "X.X"
s4 += "X.X"
s5 += "XXX"
elif i == "1":
s1 += "..X"
s2 += "..X"
s3 += "..X"
s4 += "..X"
s5 += "..X"
elif i == "2":
s1 += "XXX"
s2 += "..X"
s3 += "XXX"
s4 += "X.."
s5 += "XXX"
elif i == "3":
s1 += "XXX"
s2 += "..X"
s3 += "XXX"
s4 += "..X"
s5 += "XXX"
elif i == "4":
s1 += "X.X"
s2 += "X.X"
s3 += "XXX"
s4 += "..X"
s5 += "..X"
elif i == "5":
s1 += "XXX"
s2 += "X.."
s3 += "XXX"
s4 += "..X"
s5 += "XXX"
elif i == "6":
s1 += "XXX"
s2 += "X.."
s3 += "XXX"
s4 += "X.X"
s5 += "XXX"
elif i == "7":
s1 += "XXX"
s2 += "..X"
s3 += "..X"
s4 += "..X"
s5 += "..X"
elif i == "8":
s1 += "XXX"
s2 += "X.X"
s3 += "XXX"
s4 += "X.X"
s5 += "XXX"
elif i == "9":
s1 += "XXX"
s2 += "X.X"
s3 += "XXX"
s4 += "..X"
s5 += "XXX"
f += 1 #标记是否为最后一位
if(f!=n):
s1 += "."
s2 += "."
s3 += "."
s4 += "."
s5 += "."
print(s1);print(s2);print(s3);print(s4);print(s5)
输出和样例完全一样,但还是全WA了
求助qwq
by DownLoads @ 2020-12-26 10:10:47
@little_blue
by HYdroKomide @ 2020-12-26 10:29:13
用C++他不香吗?让我也看懵了
by 啊啊啊12321 @ 2020-12-26 11:01:41
循环次数比n多1,最后一次会在最后一列加一个"."
n = int(input())
an = input()
f = 0
s1,s2,s3,s4,s5 = "","","","",""
for i in an:
if i == "0":
s1 += "XXX"
s2 += "X.X"
s3 += "X.X"
s4 += "X.X"
s5 += "XXX"
elif i == "1":
s1 += "..X"
s2 += "..X"
s3 += "..X"
s4 += "..X"
s5 += "..X"
elif i == "2":
s1 += "XXX"
s2 += "..X"
s3 += "XXX"
s4 += "X.."
s5 += "XXX"
elif i == "3":
s1 += "XXX"
s2 += "..X"
s3 += "XXX"
s4 += "..X"
s5 += "XXX"
elif i == "4":
s1 += "X.X"
s2 += "X.X"
s3 += "XXX"
s4 += "..X"
s5 += "..X"
elif i == "5":
s1 += "XXX"
s2 += "X.."
s3 += "XXX"
s4 += "..X"
s5 += "XXX"
elif i == "6":
s1 += "XXX"
s2 += "X.."
s3 += "XXX"
s4 += "X.X"
s5 += "XXX"
elif i == "7":
s1 += "XXX"
s2 += "..X"
s3 += "..X"
s4 += "..X"
s5 += "..X"
elif i == "8":
s1 += "XXX"
s2 += "X.X"
s3 += "XXX"
s4 += "X.X"
s5 += "XXX"
elif i == "9":
s1 += "XXX"
s2 += "X.X"
s3 += "XXX"
s4 += "..X"
s5 += "XXX"
f = f + 1
if(f>n):
break
if(f!=n):
s1 += "."
s2 += "."
s3 += "."
s4 += "."
s5 += "."
print(s1);print(s2);print(s3);print(s4);print(s5)
by 啊啊啊12321 @ 2020-12-26 11:03:18
@DownLoads