-6

什么代码用于此类问题?另外,您将 rand() 的代码放在顶部还是底部?

4

1 回答 1

2

Normally you call srand(time(NULL)); once (and only once) as the program is starting up.

To ask different questions, you'd normally get a random number with rand, reduce it to the range of the number of questions, and use that to select one of the questions.

于 2012-06-20T04:43:22.987 回答