Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Permutations/BASIC256/permutations.basic
Normal file
43
Task/Permutations/BASIC256/permutations.basic
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
arraybase 1
|
||||
n = 4 : cont = 0
|
||||
dim a(n)
|
||||
dim c(n)
|
||||
|
||||
for j = 1 to n
|
||||
a[j] = j
|
||||
next j
|
||||
|
||||
do
|
||||
for i = 1 to n
|
||||
print a[i];
|
||||
next
|
||||
print " ";
|
||||
|
||||
i = n
|
||||
cont += 1
|
||||
if cont = 12 then
|
||||
print
|
||||
cont = 0
|
||||
else
|
||||
print " ";
|
||||
end if
|
||||
|
||||
do
|
||||
i -= 1
|
||||
until (i = 0) or (a[i] < a[i+1])
|
||||
j = i + 1
|
||||
k = n
|
||||
while j < k
|
||||
tmp = a[j] : a[j] = a[k] : a[k] = tmp
|
||||
j += 1
|
||||
k -= 1
|
||||
end while
|
||||
if i > 0 then
|
||||
j = i + 1
|
||||
while a[j] < a[i]
|
||||
j += 1
|
||||
end while
|
||||
tmp = a[j] : a[j] = a[i] : a[i] = tmp
|
||||
end if
|
||||
until i = 0
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue