Program n1;
const n=50;
function is5d(x: integer ): integer;
var t: integer;
begin
t:=0;
repeat
if(x mod 10=5) then t:=t+1;
x:= x div 10;
until x=0;
is5d:=t;
end;
var a: array [1..n] of integer;
i,k: integer;
begin
write('50 случайных чисел: ');
for i:=1 to n do begin
a[i]:=random(10000)+1;
write(a[i],' ');
end;
writeln;
k:=0;
for i:=1 to n do k:=k+is5d(a[i]);
write('количество 5 во всех 50 числах: ',k);
end.