• Запишите полный текст программы.
    for i:=1 to n-1 do
    begin imax:=i;
    for j:=i+1 to n do if a[j]>a[imax] then imax:=j;
    x:=a[i];
    a[i]:=a[imax];
    a [imax]:=x

Ответы 1

  • const    n = 20;var    i, imax, j, x: integer;    a: array[1..n]of integer;begin    for i := 1 to n do        a[i] := random(100);    for i := 1 to n - 1 do    begin        imax := i;        for j := i + 1 to n do             if a[j] > a[imax] then                 imax := j;        x := a[i];        a[i] := a[imax];        a[imax] := x;    end;        for i := 1 to n do      write(a[i],' ');          writeln();    writeln(imax);    end.
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years