Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
test-vscode-c-win
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸大学计算机学院
教师群组
宋海霞-shx
Test
test-vscode-c-win
提交
b1a29945
提交
b1a29945
3月 18, 2021
创建
作者:
宋海霞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交作业
上级
00e1bb19
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
46 行增加
和
7 行删除
+46
-7
tasks.json
.vscode/tasks.json
+39
-4
test.py
test.py
+4
-3
user_output1.txt
user_output1.txt
+1
-0
user_output2.txt
user_output2.txt
+1
-0
user_output3.txt
user_output3.txt
+1
-0
没有找到文件。
.vscode/tasks.json
浏览文件 @
b1a29945
...
...
@@ -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"
:
"python
3 ${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
local_
test.py
→
test.py
浏览文件 @
b1a29945
...
...
@@ -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
)
...
...
user_output1.txt
0 → 100644
浏览文件 @
b1a29945
x = -1, y = x = -1
user_output2.txt
0 → 100644
浏览文件 @
b1a29945
x = 5, y = 2 * x - 1 = 9
user_output3.txt
0 → 100644
浏览文件 @
b1a29945
x = 20, y = 3 * x - 11 = 49
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论