Задание (Pascal)

Ревизии: current

text/plain
text/html
source
Old rev.:
program task;
var nmin,nmax:real;
    min,max:real;
    a:array [1..n] of real;
begin for i:=1 to n do
      min:=a[1]; max:=a[1]; nmin:=1; nmax:=1;
      for i:=2 to n do
      begin if a[i]>max then
            begin max:=a[i];
                  nmax:=i;
            end;
            if a[i]<min then
            begin min:=a[i];
                  nmin:=i;
            end;
      end;
      a[nmax]:=min;
      a[nmin]:=max;
      WriteLn(min);
      WriteLn(max);
end.

Комментарии:

Нет