ttp://www.catnet.ne.jp/kouno/c_faq/c13.html#16
上記に
 rand() % N
よりも
 (int)((double)rand() / ((double)RAND_MAX + 1) * N)
の方がよりよい方法とあるが間違いではないのか?
以上終了。