//Я просто опишу метод записи матрицы const n=100; var ar:array of array of integer; ars:array of array of string; i:integer;
procedure complection(var ar:array of array of integer;var ars:array of array of string); var i,j:integer; begin; for i:=1 to n do begin; for j:=1 to n do begin; ar[i,j]:=random(9); str(ar[i,j],ars[i,j]); end; end; end;
procedure burning(ars:array of array of string); var i,j:integer; t:text; begin; assign(t,'text.txt'); rewrite(t); for i:=1 to n do begin; writeln(t,' '); for j:=1 to n do write(t,ars[i,j],' '); end; end;
begin; randomize; setlength(ar,n+1); setlength(ars,n+1); for i:=1 to n do begin; setlength(ar[i],n+1); setlength(ars[i],n+1); end; complection(ar,ars); burning(ars); end.
Japancosmetica
15.10.2021
1)var ar:array of integer; max,min,s,i,n,maxi,mini:integer; begin; randomize; max:=-1; min:=101; readln(n); setlength(ar,n+1); writeln('Array:'); for i:=1 to n do begin; ar[i]:=random(100); write(ar[i]:4); if max<ar[i] then begin; max:=ar[i]; maxi:=i; end; if min>ar[i] then begin; min:=ar[i]; mini:=i; end; s:=s+ar[i]; end; ar[maxi]:=s; ar[mini]:=s; writeln; writeln('Final array:'); for i:=1 to n do write(ar[i]:4); end. 2)var ar:array of integer; k,h,i,s:integer; f:real; begin; randomize; readln(h); setlength(ar,h+1); writeln('Array:'); for i:=1 to h do begin; ar[i]:=random(100)-50; write(ar[i]:4); if (ar[i]>0) and (ar[i] mod 2=0) then begin; inc(k); s:=s+ar[i]; end; end; f:=s/k; writeln; writeln('Result:',f); end.
Ответить на вопрос
Поделитесь своими знаниями, ответьте на вопрос:
Бетті кітап түрінде орнату үшін беттің орналасуын тауып беріңізш
const n=100;
var ar:array of array of integer;
ars:array of array of string;
i:integer;
procedure complection(var ar:array of array of integer;var ars:array of array of string);
var
i,j:integer;
begin;
for i:=1 to n do
begin;
for j:=1 to n do
begin;
ar[i,j]:=random(9);
str(ar[i,j],ars[i,j]);
end;
end;
end;
procedure burning(ars:array of array of string);
var
i,j:integer;
t:text;
begin;
assign(t,'text.txt');
rewrite(t);
for i:=1 to n do
begin;
writeln(t,' ');
for j:=1 to n do
write(t,ars[i,j],' ');
end;
end;
begin;
randomize;
setlength(ar,n+1);
setlength(ars,n+1);
for i:=1 to n do
begin;
setlength(ar[i],n+1);
setlength(ars[i],n+1);
end;
complection(ar,ars);
burning(ars);
end.