Переведите программу из паскаля в питон:
var
a:array[1..100]of integer;
i,j,t,n:integer;
begin
randomize;
writeln('vvedite kol-vo elementov');
readln(n);
writeln('ishodnyj massiv');
for i:=1 to n do
begin
a[i]:=random(20)-10;
write(a[i],' ');
end;
writeln;
for i:=1 to n do
for j:=1 to n-1 do
if (a[j]>=0)and(a[j+1]<0)then
begin
t:=a[j];
a[j]:=a[j+1];
a[j+1]:=t;
end;
writeln('novyj massiv');
for i:=1 to n do
write(a[i],' ');
readln;
end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.