|
zadach24.BAS |
|
{* Задача24 *}REM basic ' Рассортировать символы исходной фразы по алфавиту в обратном порядкеDim i As Integer, j As Integer, n As Integer
Dim s As String, x As String
INPUT "vvedite stroku ", s
n = LEN(s)
For i = 2 To n
For j = n To i Step -1
If ASC( Mid$(s, j - 1, 1)) < ASC( Mid$(s, j, 1)) Then
x = Mid$(s, j - 1, 1)
Mid$(s, j - 1, 1) = Mid$(s, j, 1)
Mid$(s, j, 1) = x
End If
Next
Next
PRINT s
End
|