Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program task27;
- var i, n, el, sum, max_cnt, id: integer;
- a: array[1..28] of integer;
- begin
- max_cnt := 0;
- id := 0;
- read(n);
- for i := 1 to n do begin
- read(el);
- sum := 0;
- while el <> 0 do begin
- sum := sum + (el mod 10);
- el := el div 10;
- end;
- if (sum = 0) then
- sum := 28;
- a[sum] := a[sum] + 1;
- end;
- for i := 1 to 28 do begin
- if max_cnt < a[i] then begin
- max_cnt := a[i];
- id := i;
- end;
- end;
- if id = 28 then
- id := 0;
- writeln(id);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement