var a:array[1..20] of integer; max,min,n,i:integer; begin
randomize; n:=20; for i:=1 to n do a[i]:=random(150); begin min:=a[1]; for i:=1 to n do if a[1]>a[i] then min:=a[i]; end; begin max:=a[1]; for i:=1 to n do if a[1]<a[i] then max:=a[i]; end; writeln(min); writeln(max); end.
2)
const n=5; var x: array[1..n,1..n] of integer; i,j,s: integer; begin randomize; writeln('Matrisa:'); for i:=1 to n do begin for j:=1 to n do begin x[i,j]:=random(200); write(x[i,j]:5); end; writeln end; j:=8; for i:=1 to n do begin j:=j-1; s:=s+x[i,(n+1-i)]; end; writeln('Summa: ',s); end.
var a:array[1..20] of integer; max,min,n,i:integer; begin
randomize; n:=20; for i:=1 to n do a[i]:=random(150); begin min:=a[1]; for i:=1 to n do if a[1]>a[i] then min:=a[i]; end; begin max:=a[1]; for i:=1 to n do if a[1]<a[i] then max:=a[i]; end; writeln(min); writeln(max); end.
2)
const n=5; var x: array[1..n,1..n] of integer; i,j,s: integer; begin randomize; writeln('Matrisa:'); for i:=1 to n do begin for j:=1 to n do begin x[i,j]:=random(200); write(x[i,j]:5); end; writeln end; j:=8; for i:=1 to n do begin j:=j-1; s:=s+x[i,(n+1-i)]; end; writeln('Summa: ',s); end.
1)
var a:array[1..20] of integer;
max,min,n,i:integer;
begin
randomize;
n:=20;
for i:=1 to n do a[i]:=random(150);
begin
min:=a[1];
for i:=1 to n do if a[1]>a[i] then min:=a[i];
end;
begin
max:=a[1];
for i:=1 to n do if a[1]<a[i] then max:=a[i];
end;
writeln(min);
writeln(max);
end.
2)
const n=5;
var x: array[1..n,1..n] of integer;
i,j,s: integer;
begin
randomize;
writeln('Matrisa:');
for i:=1 to n do
begin
for j:=1 to n do
begin
x[i,j]:=random(200);
write(x[i,j]:5);
end;
writeln
end;
j:=8;
for i:=1 to n do
begin
j:=j-1;
s:=s+x[i,(n+1-i)];
end;
writeln('Summa: ',s);
end.
1)
var a:array[1..20] of integer;
max,min,n,i:integer;
begin
randomize;
n:=20;
for i:=1 to n do a[i]:=random(150);
begin
min:=a[1];
for i:=1 to n do if a[1]>a[i] then min:=a[i];
end;
begin
max:=a[1];
for i:=1 to n do if a[1]<a[i] then max:=a[i];
end;
writeln(min);
writeln(max);
end.
2)
const n=5;
var x: array[1..n,1..n] of integer;
i,j,s: integer;
begin
randomize;
writeln('Matrisa:');
for i:=1 to n do
begin
for j:=1 to n do
begin
x[i,j]:=random(200);
write(x[i,j]:5);
end;
writeln
end;
j:=8;
for i:=1 to n do
begin
j:=j-1;
s:=s+x[i,(n+1-i)];
end;
writeln('Summa: ',s);
end.