Portál AbcLinuxu, 17. července 2025 07:12
10 pocet = 52 20 dim pole(pocet) 30 for i = 1 to 52 : pole(i) = i : next i 40 if pocet < 1 then goto 90 50 n = int(rnd(1)*pocet)+1 60 w = pole(pocet) : pole(pocet) = pole(n) : pole(n) = w 70 pocet = pocet-1 80 goto 40 90 for i = 1 to 52 : print pole(i), : next i 100 print : endTak s tím se ten můj obrácený bubblesort fakt srovnávat nedá
10 pocet = 52 20 dim pole(pocet) 30 for i = 1 to 52 40 n = int(rnd(1)*pocet) 50 n = n+1 : if n > 52 then n = 1 60 for j = 1 to i 70 if pole(j) = n then goto 50 80 next j 90 pole(i) = n 100 next i 110 for i = 1 to 52 : print pole(i), : next i 120 print : end
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.