GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles/2007.02.21/ |
Upload File : |
' This is a demonstration of how to sort MYNUMBERSIZE number of numbers. ' This is a much better way to do it than with if statements. ' To sort 20 numbers, it would require ~2162579562823679999 if statements. MYNUMBERSIZE = 20 dim myNumber(MYNUMBERSIZE) print "This program will allow you to enter ";MYNUMBERSIZE;" numbers and then display" print "them in numerical order." print '1. Input MYNUMBERSIZE numbers with appropriate output to identify what is wanted from the user. for i = 1 to MYNUMBERSIZE print "Enter number ";i;":"; input " ";myNumber(i) next i '2. Display the numbers in numerical order with appropriate text to identify output. ' Sort the numbers. This example uses a bubble sort. for i = 1 to MYNUMBERSIZE-1 for j = i+1 to MYNUMBERSIZE if myNumber(i) > myNumber(j) then temp = myNumber(i) myNumber(i) = myNumber(j) myNumber(j) = temp end if next j next i ' Display the numbers print "The numbers in order are:"; for i = 1 to MYNUMBERSIZE print " ";myNumber(i); next i print "."