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 /09/TP-HN-2014/cau3.pas | |
parent | b2d80610db6beda38573890ed169815e495bc663 (diff) | |
download | cp-2f674dc80f0382f1c3178f435714960734dc9d3c.tar.gz |
Reorganize stuff from secondary school
Diffstat (limited to '09/TP-HN-2014/cau3.pas')
-rw-r--r-- | 09/TP-HN-2014/cau3.pas | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/09/TP-HN-2014/cau3.pas b/09/TP-HN-2014/cau3.pas deleted file mode 100644 index 1785da9..0000000 --- a/09/TP-HN-2014/cau3.pas +++ /dev/null @@ -1,59 +0,0 @@ -var - f: text; - s: string; - c: char; - a: array of byte; - i, j: byte; - tmp: byte = 0; - - -function palin( - s: string; - l, h: byte -): boolean; - - begin - while l <= h do - begin - if s[l] <> s[h] then - exit(false); - - inc(l); - dec(h); - end; - - palin := true - end; - - - -begin - assign(f, 'CAU3.INP'); - reset(f); - readln(f, s); - close(f); - - setlength(a, 256); - for i := 0 to 255 do - a[i] := 0; - - for c in s do - inc(a[ord(c)]); - - for i in a do - if i > 0 then - inc(tmp); - - assign(f, 'CAU3.OUT'); - rewrite(f); - writeln(f, tmp); - - tmp := 0; - for i := 1 to length(s) - 1 do - for j := i + tmp to length(s) do - if palin(s, i, j) then - tmp := j - i + 1; - - writeln(f, tmp); - close(f) -end. |