about summary refs log tree commit diff
path: root/others/volume1/028.pas
blob: f135a67d04abf60c02dced51f0fc74fe41778d14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var
  a, i: int16;
  b: array[0..9999] of boolean;

begin
  for i := 0 to 9999 do
    b[i] := false;
  readln(a);
  for i := 0 to 9999 do
    begin
      b[a] := true;
      a := sqr(a) div 100 mod 10000
    end;
  a := 0;
  for i := 0 to 9999 do
    if b[i] then
      inc(a);
  writeln(a)
end.