Browse Source

Ugly fix is ugly

content-update
Xavier Petit 4 years ago
parent
commit
1daad3d1a4
No known key found for this signature in database
GPG Key ID: CA3F2B17E25ABD26
  1. 5
      go/tests/prog/reverserange_prog/main.go

5
go/tests/prog/reverserange_prog/main.go

@ -3,6 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"os" "os"
"sort"
"strconv" "strconv"
"lib" "lib"
@ -22,7 +23,9 @@ func main() {
fmt.Println(err) fmt.Println(err)
return return
} }
for _, i := range lib.IntRange(b, a) { suite := lib.IntRange(a, b)
sort.Sort(sort.Reverse(sort.IntSlice(suite)))
for _, i := range suite {
fmt.Print(i) fmt.Print(i)
} }
fmt.Println() fmt.Println()

Loading…
Cancel
Save