QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#764863#9255. Python Program1903331632WA 10ms10500kbPython3407b2024-11-20 10:58:232024-11-20 10:58:29

Judging History

你现在查看的是最新测评结果

  • [2024-11-20 10:58:29]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:10500kb
  • [2024-11-20 10:58:23]
  • 提交

answer

# 提示用户输入多行代码
print("请输入多行Python代码(以一行空行结束):")
user_code = []
for i in range(0,5):
    line = input()  # 一次读取一行
    user_code.append(line)

# 将代码拼接成完整的代码块
code_to_execute = "\n".join(user_code)

# 执行代码
try:
    exec(code_to_execute)
except Exception as e:
    print(f"代码执行出错:{e}")

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 10ms
memory: 10500kb

input:

ans=0
for a in range(1,3):
    for b in range(5,1,-2):
        ans+=b
print(ans)

output:

请输入多行Python代码(以一行空行结束):
16

result:

wrong answer 1st lines differ - expected: '16', found: '请输入多行Python代码(以一行空行结束):'