zoukankan      html  css  js  c++  java
  • Linbux下的Bash对拍

    下面是(Linux)下的(bash)对拍程序:

    #!/bin/bash
    t=0 //数据组数
    while true; do
        let "t=$t + 1" echox
        printf $t                                 //bash语言的变量前需要加 $
        printf ": "
        ./datamaker > input              //数据生成器
        ./color < input > output         //需要对拍的程序
        ./std < input > stdout            //标程
        
        if diff output stdout; then
            printf "Accepted
    "
        else
            printf "Wrong Answer
    "
            break
        fi
        sleep 0.2s
    done
     
    //请在使用前删除中文注释
    

    在终端下运行,不需要编译

    文件名保存为:pai.sh

    在终端下运行:chmod +x pai.sh

    在终端下运行:./pai.sh

  • 相关阅读:
    数据库练习
    pymysql
    数据库索引
    数据库查询
    数据库操作
    数据库建表
    数据库初识
    shell 编程
    Struts2与SpringMVC
    SpringAOP
  • 原文地址:https://www.cnblogs.com/Hero-of-someone/p/11725880.html
Copyright © 2011-2022 走看看