当我粘贴此内容时:
t= int(input())
s=int(input())
h=int(input())
sp= (" ")
d=("*")
def trident(t, s, h, sp, d):
gap = " "*s
top = d+ gap+d+gap+d+gap
fult = []
for x in range (t):
fult.append(top)
midnum= (2*s)+3
mid = d* midnum
spacec = s+1
spaceb= spacec * sp
spacebot=spaceb+d+"\n"
bottem1=spacebot
bottem=bottem1*h
full= fult+[mid]+[bottem]
return full
full = trident(t, s, h, sp, d)
for line in full:
print(line)`
进入此:https://dmoj.ca/problem/ccc03j1/submit 它说存在空格错误。为什么?
我测试了代码,输出很棒,但结果显示空格错误`
如果您查看提交时提供的反馈,更准确地说反馈是“演示错误”,请检查您的空格,这会告诉您您的解决方案对空格取模是正确的。因此,无论你做错了什么,都与你正在打印的空白有关。这既指换行符,也指空格。
标准 DMOJ 检查器会错误地将对此问题的提交标记为 AC,因此对此问题有一个相同的检查器,它检查您的输出是否与判断输出完全相同。如果您打印太多或太少的空白字符,但您已经打印了正确的答案,您将收到带有演示错误的 WA 判决,请检查您的空白反馈。
请检查您的解决方案并确保仅在需要的地方打印空白。