2012-11-18 13:30:49 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2012-11-19 00:00:50 +00:00
|
|
|
"bufio"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"sort"
|
|
|
|
)
|
|
|
|
|
|
|
|
import (
|
|
|
|
"meatballhat.com/algs4"
|
2012-11-18 13:30:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2012-11-19 00:00:50 +00:00
|
|
|
whiteList, err := algs4.ReadInts(bufio.NewReader(os.Stdin))
|
|
|
|
sort.Ints(whiteList)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("UGH: ", err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2012-11-18 13:30:49 +00:00
|
|
|
|
2012-11-19 00:00:50 +00:00
|
|
|
fmt.Println("Sorted whitelist:")
|
2012-11-18 13:30:49 +00:00
|
|
|
|
2012-11-19 00:00:50 +00:00
|
|
|
for i := range whiteList {
|
|
|
|
fmt.Println(i)
|
|
|
|
}
|
2012-11-18 13:30:49 +00:00
|
|
|
}
|