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