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