[파일명:  testSort.boo]------------------------------------------------
import System
import System.Collections

def printArray(arr as Array):
    Console.Write("[")
    for i in range(0, len(arr) - 1):
        s = "${arr[i]}, "
        Console.Write(s)
    if len(arr) > 0:
        Console.Write("{0}", "${arr[len(arr) - 1]}")
    Console.WriteLine("]")

arr = array(String, argv.Length)
for i in range(0,  argv.Length):
    arr[i] = argv[i]

Array.Sort(arr)
printArray(arr)
------------------------------------------------


실행> booi testSort.boo one two thee four five
[five, four, one, three, four]

실행> booi testSort.boo 하나 둘 셋 넷 다섯
[넷, 다섯, 둘, 셋, 하나]

 

크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by Scripter
,