Go言語でCodeEvalのSimple Sorting

CodeEval

スペース区切りで少数が渡されるので単純に昇順でソートして出力する

input.txt

70.920 -38.797 14.354 99.323 90.374 7.581
-37.507 -3.263 40.079 27.999 65.213 -55.552

output

-38.797 7.581 14.354 70.920 90.374 99.323
-55.552 -37.507 -3.263 27.999 40.079 65.213


golangのsortパッケージにFloat64s関数があって、これでfloat64をソートできる。
出力はstrconv.FormatFloatで


参考 : sort - The Go Programming Language
参考 : strconv - The Go Programming Language