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.
このタイプの問題にはどのコードが使用されますか? また、rand() のコードを上部または下部のどこに配置しますか?
通常srand(time(NULL));、プログラムの起動時に 1 回 (そして 1 回だけ) 呼び出します。
srand(time(NULL));
異なる質問をするには、通常、 で乱数を取得しrand、それを質問数の範囲に減らし、それを使用して質問の 1 つを選択します。
rand