From 2f674dc80f0382f1c3178f435714960734dc9d3c Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 6 Jun 2020 21:33:13 +0700 Subject: Reorganize stuff from secondary school --- 2ndary/12/TP-HN-2008/R1/BL1.PAS | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 2ndary/12/TP-HN-2008/R1/BL1.PAS (limited to '2ndary/12/TP-HN-2008/R1/BL1.PAS') diff --git a/2ndary/12/TP-HN-2008/R1/BL1.PAS b/2ndary/12/TP-HN-2008/R1/BL1.PAS new file mode 100644 index 0000000..6931b1b --- /dev/null +++ b/2ndary/12/TP-HN-2008/R1/BL1.PAS @@ -0,0 +1,26 @@ +uses math; + +var + f : text; + m, n, i : byte; + a, b : double; +j +begin + assign(f, 'LT.IN'); + reset(f); + read(f, n, m); + close(f); + a := 1; + for i := 1 to n do + a := a * 2; + b := 1; + for i := 1 to m do + b := b * 3; + a := a + b; + for i := 1 to trunc(log10(a)) do + a := a / 10; + assign(f, 'LT.OU'); + rewrite(f); + writeln(f, trunc(a)); + close(f) +end. -- cgit 1.4.1