Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const n=15;
- var x:array [1..n] of integer;
- i,index:byte;
- temp:integer;
- Begin
- Writeln('Исходный массив:');
- for i:=1 to n do
- Begin
- X[i]:=Random(51)-15;
- Write(X[i]:4);
- end;
- Writeln;
- Index:=1;
- for i:=2 to n do if X[Index] > X[i] then Index:=i;
- Temp:=X[Succ(n div 2)];
- X[Succ(n div 2)]:=X[Index];
- X[Index]:=Temp;
- Writeln('Сформированный массив:');
- for i:=1 to n do Write(X[i]:4);
- Writeln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement