|
zadach110.BAS |
|
{* Задача110 *}REM basic ' Поменять местами положительные и отрицательные числа в массивеDim a(10)
For i = 1 To 10
INPUT "vvedite element ", a(i)
Next
PRINT "ishodnyj massiv"
For i = 1 To 10
PRINT a(i);
Next
PRINT
k = 1
For i = 1 To 10
If a(i) < 0 Then
t = a(i)
For j = i To k + 1 Step -1
a(j) = a(j - 1)
Next
a(k) = t
k = k + 1
End If
Next
PRINT "novyj massiv"
For i = 1 To 10
PRINT a(i);
Next
End
|