Skip to content

Instantly share code, notes, and snippets.

@nida-001
Created June 9, 2013 14:50
Show Gist options
  • Save nida-001/5743811 to your computer and use it in GitHub Desktop.
Save nida-001/5743811 to your computer and use it in GitHub Desktop.
「暗号文」
package main
import (
"fmt"
"sort"
)
func main() {
numbers := []int{1, 2, 3}
fmt.Printf("%v\n", encrypt(numbers))
}
func encrypt(numbers []int) int64 {
var ret int64 = 1
sort.Ints(numbers)
numbers[0]++
for i := 0; i < len(numbers); i++ {
ret *= int64(numbers[i])
}
return ret
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment