diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-06-06 21:33:13 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-06-06 21:33:13 +0700 |
commit | 2f674dc80f0382f1c3178f435714960734dc9d3c (patch) | |
tree | 2abba7e4ec72bd16f58f7375126144d3fd9f4bca /2ndary/THT/C/TP-2016/set.pas | |
parent | b2d80610db6beda38573890ed169815e495bc663 (diff) | |
download | cp-2f674dc80f0382f1c3178f435714960734dc9d3c.tar.gz |
Reorganize stuff from secondary school
Diffstat (limited to '2ndary/THT/C/TP-2016/set.pas')
-rw-r--r-- | 2ndary/THT/C/TP-2016/set.pas | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/2ndary/THT/C/TP-2016/set.pas b/2ndary/THT/C/TP-2016/set.pas new file mode 100644 index 0000000..c36dc23 --- /dev/null +++ b/2ndary/THT/C/TP-2016/set.pas @@ -0,0 +1,24 @@ +var + f : text; + m, n, id : shortint; + {This, because random failed on Windows, may because of not having /dev/urandom} + out : array[1..8] of shortint = (5, 1, 3, 7, 2, 6, 4, 8); + +begin + assign(f, 'set.inp'); + reset(f); + readln(f, m, n, id); + close(f); + if id = 2 then + begin + m := n; + n := 5 + end + else + n := 4; + assign(f, 'set.out'); + rewrite(f); + for id := 1 to m do + writeln(f, n, ' ', out[id]); + close(f) +end. \ No newline at end of file |