Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
int fun1();乱数 x1 satisfies を返すことができる関数があるとします0<x1<m。
int fun1();
0<x1<m
fun1()関数を使用して別の関数を生成しint fun2()、x2 を満たす乱数を返すにはどうすればよい0<x2<nですか?
fun1()
int fun2()
0<x2<n
次のように書く必要があります。
return fun1() * n / m;