Quick sample check script for contests

This commit is contained in:
Abhay Rana 2014-10-13 04:58:32 +05:30
parent 38d25b2818
commit dd5cd68c07
1 changed files with 22 additions and 0 deletions

22
cct Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
FILE=$(basename "$1")
EXT="${FILE##*.}"
CODE="${FILE%.*}"
SUFFIX=""
case "$EXT" in
"rb" )
BIN="ruby"
;;
"py" )
BIN="python"
;;
"cpp" )
BIN="g++"
SUFFIX="&& ./a.out"
;;
esac
# Now lets run the code
`cat $CODE.IN | $BIN $FILE $SUFFIX > $CODE.OUT`
diff $CODE.OUT $CODE.OUT