From 8555f1e30e20daa611c4a25d7ca026e3f414d66e Mon Sep 17 00:00:00 2001 From: dm1sh Date: Sun, 31 Oct 2021 15:04:02 +0300 Subject: [PATCH] Added python script for test input generation and shell script for running --- .gitignore | 3 ++- input.py | 11 +++++++++++ run.sh | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 input.py create mode 100755 run.sh diff --git a/.gitignore b/.gitignore index 71c7e11..2a73ca0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ a.out main .vscode -vgcore* \ No newline at end of file +vgcore* +output.txt \ No newline at end of file diff --git a/input.py b/input.py new file mode 100644 index 0000000..699f4a9 --- /dev/null +++ b/input.py @@ -0,0 +1,11 @@ +import sys + +try: + n = int(sys.argv[1]) +except: + n = 5 + +print(n) + +for i in range(n): + print(i, -i if i % 2 == 0 else i) \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..941d338 --- /dev/null +++ b/run.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +gcc main.c +python input.py $1 | tee /dev/fd/2 | ./a.out | tee output.txt \ No newline at end of file