
Арий
7 год назад
Удалить все отрицательные элементы массива и расположить оставшиеся по убыванию
ОТВЕТЫ

Rakansekr
Aug 13, 2019
Cls
input n
dim a(n)
s=0
for i=1 to n
input a(i)
next i
for i=1 to n
if a(i)gt;0 then s=s+1
next i
if sgt;0 then
p=1:t=0
dim b(s)
for i=1 to s
for j=p to n
t=t+1
if a(j)gt;0 then b(i)=a(j) goto 1
next j
1: p=t
next i
for i=1 to s
for j=1 to s
if b(i)lt;b(j) then swap b(i),b(j)
next j
next i
for i=1 to s
print b(i);
next i
end if
input n
dim a(n)
s=0
for i=1 to n
input a(i)
next i
for i=1 to n
if a(i)gt;0 then s=s+1
next i
if sgt;0 then
p=1:t=0
dim b(s)
for i=1 to s
for j=p to n
t=t+1
if a(j)gt;0 then b(i)=a(j) goto 1
next j
1: p=t
next i
for i=1 to s
for j=1 to s
if b(i)lt;b(j) then swap b(i),b(j)
next j
next i
for i=1 to s
print b(i);
next i
end if
40