评测脚本
网上找找不怎么到好的脚本,有一个看起来有点靠谱那么就mark一下。
#!/bin/bash
for i in 1 2 3 4 5 6 7 8 9 10;
do
cat > transform.in < transform${i}.in
./a.out
tmp=$(diff -b transform${i}.ans transform.out)
if [ "$tmp" == "" ]
then
echo "#${i} correct"
else
echo "#${i} incorrect"
cat transform.out
echo
cat transform${i}.ans
echo
fi
done
“这是我用来测noi2009 变换序列的脚本
使用:
保存为transfer.sh,在终端输入
[C++]
sudo chmod +x transfer.sh
添加可执行权限
[C++]
./transfer.sh
运行即可
当然了,测试的程序必须是文件输入输出。”
Sometimes it s the very people who no one imagines anything of. who do the things that no one can imagine.