- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
#include "basic.hpp"
int main()
{
_10: DIM F(10);
_11: LET I = 0;
_12: LET J = 0;
_13: LET TMP = 0;
_20: FOR I = 1 TO 10;
_30: F(I) = RND();
_35: PRINT F(I);
_40: NEXT
_50: FOR I = 1 TO 9;
_60: FOR J = I + 1 TO 10;
_70: IF F(J) > F(I) THEN GOTO _110;
_80: TMP = F(I);
_90: F(I) = F(J);
_100: F(J) = TMP;
_110: NEXT;
_120: NEXT;
_130: PRINT "reordered";
_140: FOR I = 1 TO 10;
_150: PRINT F(I);
_160: NEXT
}
cykablyad 03.03.2017 11:55 # +3
guest 03.03.2017 14:46 # +2
wano987 03.03.2017 16:00 # 0
Но это не Бейсик. Строки хранятся не в массиве.