Program Pr; Var a : array [1..100, 1..100] of integer; i, max, min, j, n: integer; Begin cls; read(n); min := 100000; max := -100000; for i := 1 to n do for j := 1 to n do begin read(a[i,j]); if (a[i,j] > max) then max := a[i,j]; if (a[i,j] < min) then min := a[i,j]; end; writeln ('Сумма = ', min + max); writeln ('Разность = ', max - min); writeln ('Произведение = ', max * min);
Program qw; uses crt; Type Atlas=Record country,capital:string; area,people:real; end; ps=File of atlas; Var f:ps; z,t:atlas; Begin assign(f,'1.dat'); rewrite(f); z.country:='Латвия'; z.area:=67.7; z.people:=2.6; z.capital:='Рига'; write(f,z); z.country:='Литва'; z.area:=65.2; z.people:=3.4; z.capital:='Вильнюс'; write(f,z); z.country:='Польша'; z.area:=313; z.people:=34.8; z.capital:='Варшава'; write(f,z); z.country:='Украина'; z.area:=603.7; z.people:=50; z.capital:='Киев'; write(f,z); z.country:='Россия'; z.area:=17075.4; z.people:=139; z.capital:='Москва'; write(f,z); Close(f); assign(f,'1.dat'); reset(f); read(f,t); while not(eof(f)) do begin read(f,z); if t.people/t.area < z.people/z.area then t:=z; end; close(f); writeln('Cтранa с наибольшей плотностью населения:'); writeln(t.country,' (плотность населения равна ',t.people/t.area:9:6,' млн на кв.км)'); end.
Var
a : array [1..100, 1..100] of integer;
i, max, min, j, n: integer;
Begin
cls;
read(n);
min := 100000;
max := -100000;
for i := 1 to n do
for j := 1 to n do
begin
read(a[i,j]);
if (a[i,j] > max) then
max := a[i,j];
if (a[i,j] < min) then
min := a[i,j];
end;
writeln ('Сумма = ', min + max);
writeln ('Разность = ', max - min);
writeln ('Произведение = ', max * min);
End.
Program qw;
uses crt;
Type
Atlas=Record
country,capital:string;
area,people:real;
end;
ps=File of atlas;
Var f:ps;
z,t:atlas;
Begin
assign(f,'1.dat');
rewrite(f);
z.country:='Латвия'; z.area:=67.7;
z.people:=2.6; z.capital:='Рига';
write(f,z);
z.country:='Литва'; z.area:=65.2;
z.people:=3.4; z.capital:='Вильнюс';
write(f,z);
z.country:='Польша'; z.area:=313;
z.people:=34.8; z.capital:='Варшава';
write(f,z);
z.country:='Украина'; z.area:=603.7;
z.people:=50; z.capital:='Киев';
write(f,z);
z.country:='Россия'; z.area:=17075.4;
z.people:=139; z.capital:='Москва';
write(f,z);
Close(f);
assign(f,'1.dat');
reset(f);
read(f,t);
while not(eof(f)) do
begin
read(f,z);
if t.people/t.area < z.people/z.area then t:=z;
end;
close(f);
writeln('Cтранa с наибольшей плотностью населения:');
writeln(t.country,' (плотность населения равна ',t.people/t.area:9:6,' млн на кв.км)');
end.