重複の可能性:
範囲全体で一様に乱数を生成する
C++ random float
c++ で 5 から 25 までの乱数を生成するにはどうすればよいですか?
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
void main() {
int number;
int randomNum;
srand(time(NULL));
randomNum = rand();
}