Const n = 50; // количество чиселvar k: array [1..n] of integer; i, j, n1, n2, minr, a, b: integer; begin writeln(n, ' ', ': d'); a : = random(1000); b : = random(1000); minr : = 10000; for i : = 1 to n do k[i] : = a + random(b); for i : = 1 to n do for j : = 1 to n do if ((abs(k[i] - k[j])) < minr) and (k[i] < > k[j]) then begin minr : = abs(k[i] - k[j]); n1 : = i; n2 : = j; end; writeln(n1, ' ', n2); end.
function IsPositive(a:integer):boolean; begin result:=(a>-1); end;
procedure work; var min, max, count:integer; begin count:=0; min:=m[0]; max:=0; for i:=0 to 14 do begin if IsPositive(m[i]) then begin inc(count); if m[i]>max then max:=m[i]; if m[i]<min then min:=m[i]; end; end; writeln('MAX: ', max); writeln('MIN: ', min); writeln('Count: ', count); end;
begin for i:=0 to 14 do begin write('n: '); readln(m[i]); end;
var m:array [0..14] of integer; i:integer;
function IsPositive(a:integer):boolean;
begin
result:=(a>-1);
end;
procedure work;
var min, max, count:integer;
begin
count:=0;
min:=m[0];
max:=0;
for i:=0 to 14 do begin
if IsPositive(m[i]) then begin
inc(count);
if m[i]>max then max:=m[i];
if m[i]<min then min:=m[i];
end;
end;
writeln('MAX: ', max);
writeln('MIN: ', min);
writeln('Count: ', count);
end;
begin
for i:=0 to 14 do begin
write('n: ');
readln(m[i]);
end;
work;
readln;
end.