HowieHz同志使用Simple(不完全标准)写的排序算法,真的是狠人!
put '输入需要排序的数字数量(n)之后回车。在之后输入需要排序的数字,输入完之后回车\n'
put 'n = '
key n
num n
a : [0]*n
iii : 0
num iii
:: read_array_loop
iii == n -> read_array_end
put 'array'
put iii
put ' = '
key a[iii]
num a[iii]
iii : iii+1
-> read_array_loop
:: read_array_end
i : 0
num i
temp : 0
num temp
j : 0
num j
:: loop
i == n -> end
j : i + 1
:: loop2
j == n -> end2
a[i] > a[j] -> swap
-> next_j
:: swap
temp : a[i]
a[i] : a[j]
a[j] : temp
:: next_j
j : j+1
-> loop2
:: end2
i : i+1
-> loop
:: end
ii : 0
num ii
:: print_loop
ii == n -> print_end
put a[ii]
put ' '
ii : ii+1
-> print_loop
:: print_end
put '\n'
so fun
原始 C++ 代码φ( ̄∇ ̄o)