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.
26 lines
429 B
26 lines
429 B
5 years ago
|
package main
|
||
5 years ago
|
|
||
5 years ago
|
import (
|
||
5 years ago
|
student "student"
|
||
|
|
||
|
"lib"
|
||
5 years ago
|
)
|
||
5 years ago
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
i := 0
|
||
5 years ago
|
for i < lib.SliceLen {
|
||
|
a := lib.RandInt()
|
||
|
b := lib.RandInt()
|
||
5 years ago
|
var div int
|
||
|
var mod int
|
||
|
student.DivMod(a, b, &div, &mod)
|
||
|
if div != a/b {
|
||
5 years ago
|
lib.Fatalf("DivMod(%d, %d, &div, &mod), div == %d instead of %d", a, b, div, a/b)
|
||
5 years ago
|
}
|
||
|
if mod != a%b {
|
||
5 years ago
|
lib.Fatalf("DivMod(%d, %d, &div, &mod), mod == %d instead of %d", a, b, mod, a%b)
|
||
5 years ago
|
}
|
||
|
i++
|
||
|
}
|
||
|
}
|