• Удалить все отрицательные элементы массива и расположить оставшиеся по убыванию

Ответы 1

  • clsinput ndim a(n)s=0for i=1 to n  input a(i)next ifor i=1 to n  if a(i)>0 then s=s+1next iif s>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)>0 then b(i)=a(j) goto 1    next j1: p=t  next i  for i=1 to s    for j=1 to s      if b(i)<b(j) then swap b(i),b(j)    next j  next ifor i=1 to s  print b(i);next iend if
  • Добавить свой ответ

Войти через Google

или

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

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

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