tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,26 @@
defint a-z
option base 1
input "n=",n
dim a(n)
for i=1 to n: a(i)=i: next
do
for i=1 to n: print a(i);: next: print
i=n
do
decr i
loop until i=0 or a(i)<a(i+1)
j=i+1
k=n
while j<k
swap a(j),a(k)
incr j
decr k
wend
if i>0 then
j=i+1
while a(j)<a(i)
incr j
wend
swap a(i),a(j)
end if
loop until i=0