提交 b1a29945 创建 作者: 宋海霞's avatar 宋海霞

提交作业

上级 00e1bb19
......@@ -2,7 +2,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "make",
"label": "生成项目(make)",
"type": "shell",
"command": "make",
"args": [],
......@@ -13,9 +13,9 @@
"problemMatcher": "$msCompile"
},
{
"label": "local_test",
"label": "测试(test)",
"type": "shell",
"command": "python ${workspaceFolder}/local_test.py",
"command": "python3 ${workspaceFolder}/test.py",
"args": [],
"group": "build",
"presentation": {
......@@ -24,7 +24,7 @@
"problemMatcher": "$msCompile"
},
{
"label": "clean",
"label": "清理项目(clean)",
"type": "shell",
"command": "make clean",
"args": [],
......@@ -33,6 +33,40 @@
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "查看Git中的用户配置用户信息",
"type": "shell",
"command": "git config --global user.name && git config --global user.email",
"args": [],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "运行(Run)",
"type": "shell",
"command": "./app.exe",
"args": [],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "提交作业",
"type": "shell",
"command": "git add . && git commit -m \"提交作业\" && git push",
"args": [],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
\ No newline at end of file
......@@ -238,11 +238,12 @@ if __name__ == "__main__":
if os.path.isfile(outputFile) and os.path.isfile(useroutputFile):
if compare_file(outputFile, useroutputFile, seqNum, caseCount) == 0:
if bIncludeCi :
print("使用的标准输入文件是 intput{0}.txt。\n标准答案输出文件 output{1}.txt(左边)与用户编写的应用程序输出文件 user_output{2}.txt(右边)的比较结果:".format(seqNum, seqNum, seqNum))
runCommand = "diff {0} {1} -b -B -y -i -W 100".format(outputFile, useroutputFile)
execResult = os.system(runCommand)
if execResult != 0:
errorInfo = "输出结果比较异常,返回值:{0}。".format(execResult)
outputPromptInfo(bIncludeCi, errorInfo, 2)
#if execResult != 0:
# errorInfo = "输出结果比较异常,返回值:{0}。".format(execResult)
# outputPromptInfo(bIncludeCi, errorInfo, 2)
else:
promptInfo = "提示:\n请使用以下方式打开文件的比较结果:\n选择View菜单中的Explorer菜单项,在打开的文件列表中,右击result_comparation.html文件,\n在弹出的菜单中选择“Open Preview”菜单项,可以打开比较结果输出文件,可帮助用户查找验证失败的原因。"
outputPromptInfo(bIncludeCi, promptInfo, 2)
......
x = -1, y = x = -1
x = 5, y = 2 * x - 1 = 9
x = 20, y = 3 * x - 11 = 49
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论