C 获得随机数
#include
using namespace std;
time_t temp_time; srand((unsigned)time(&temp_time));//初始化随机种子 int r = (rand() % 256); //0-255 int r1 = (rand() % 10); //0-9 int r2 = (rand() % 100); //0-99
#include
using namespace std;
time_t temp_time; srand((unsigned)time(&temp_time));//初始化随机种子 int r = (rand() % 256); //0-255 int r1 = (rand() % 10); //0-9 int r2 = (rand() % 100); //0-99
暂无评论。
评论功能维护中,当前仅展示历史评论。