mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
499 B
27 lines
499 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"sort"
|
||
|
|
||
|
"github.com/01-edu/public/tests/go/lib"
|
||
|
|
||
|
"./student"
|
||
|
)
|
||
|
|
||
|
// Receives 5 ints and returns the number in the middle
|
||
|
func abort(a, b, c, d, e int) int {
|
||
|
arg := []int{a, b, c, d, e}
|
||
|
sort.Ints(arg)
|
||
|
return arg[2]
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
arg := lib.MultRandInt()
|
||
|
arg = append(arg, lib.RandInt())
|
||
|
for i := 0; i < 15; i++ {
|
||
|
lib.Challenge("Abort", student.Abort, abort, arg[0], arg[1], arg[2], arg[3], arg[4])
|
||
|
arg = lib.MultRandInt()
|
||
|
arg = append(arg, lib.RandInt())
|
||
|
}
|
||
|
}
|