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 /12/TP-HN-2015/bai1.pas | |
parent | b2d80610db6beda38573890ed169815e495bc663 (diff) | |
download | cp-2f674dc80f0382f1c3178f435714960734dc9d3c.tar.gz |
Reorganize stuff from secondary school
Diffstat (limited to '12/TP-HN-2015/bai1.pas')
-rw-r--r-- | 12/TP-HN-2015/bai1.pas | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/12/TP-HN-2015/bai1.pas b/12/TP-HN-2015/bai1.pas deleted file mode 100644 index 312f2b4..0000000 --- a/12/TP-HN-2015/bai1.pas +++ /dev/null @@ -1,38 +0,0 @@ -var - a, b, c, x, v: smallint; - f: text; - - -function gcd(m, n: smallint): smallint; - var - p: smallint; - - begin - while (n <> 0) do - begin - p := m mod n; - m := n; - n := p - end; - - exit(m) - end; - - -begin - assign(f, 'BAI1.INP'); - reset(f); - read(f, a, b, c); - close(f); - - v := 0; - for x := 1 to c div a do - if ((c - a * x) mod b = 0) and - (gcd(x, (c - a * x) div b) = 1) then - inc(v); - - assign(f, 'BAI1.OUT'); - rewrite(f); - writeln(f, v); - close(f) -end. |