Bash at Linbux to beat

Here is \ (Linux \) under \ (bash \) to take the program:

#!/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\n"
    else
        printf "Wrong Answer\n"
        break
    fi
    sleep 0.2s
done
 
//请在使用前删除中文注释

Running in the terminal, you do not need to compile

Save the file name is: pai.sh

Running in the terminal: chmod + x pai.sh

Running in the terminal: ./ pai.sh

Guess you like

Origin www.cnblogs.com/Hero-of-someone/p/11725880.html