Kwwiker

Отбор 7.27

Aug 9th, 2020
114
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2.   a: array [1..9] of integer;
  3.   i, n, t, min, first: integer;
  4.  
  5. begin
  6.   first := 0;
  7.   readln(n);
  8.   min := n;
  9.   for i := 1 to 9 do
  10.     a[i] := 0;
  11.   for i := 1 to n do
  12.   begin
  13.     readln(t);
  14.     while (t > 0) do
  15.     begin
  16.       first := t mod 10;
  17.       t := t div 10;
  18.     end;
  19.     a[first] := a[first] + 1;
  20.   end;
  21.   for i := 1 to n do
  22.   begin
  23.     if (a[i] <> 0) and (a[i] < min) then begin
  24.       min := a[i];
  25.       first := i;
  26.     end;
  27.   end;
  28.   writeln(first);
  29. end.
RAW Paste Data