Найти N (M задано) На 38 ходу получаем данную сумму
Uses Crt;
const
n=6;
var
i,k:byte;
p:longint;
a:array[1..n] of shortint;
begin
Randomize;
k:=0; p:=1;
ClrScr;
for i:=1 to n do begin
a[i]:=Random(51)-25; { [-25..25] }
Write(a[i],' ');
if a[i] mod 5=0 then begin k:=k+1; p:=p*a[i] end
end;
Writeln; Writeln('k=',k,', P=',p);
ReadKey
end.
Var a,S:integer;
Begin
Writeln("Введите сторону квадрата a");
Readln(a);
S:=sqr(a);
Writeln("Площадь квадрата S=",S);
readln;
end.
var a:array[1..20] of integer; i,arf,k:integer;
begin
k:=0;
for i:=1 to 20 do
begin
a[i]:=random(10);
if (a[i]/2=a[i] div 2) or (i/2<>i div 2) then
begin arf:=arf+a[i]; inc(k); end;
end;
arf:=round(arf/k);
for i:=1 to 20 do writeln('a[',i,']= ',a[i]);
writeln('Srendee arirfm. chentix chisel u nechetnix indexov = ',arf);
readln;
end.