#include <iostream> #include<stdio.h> #include<time.h> #define random(x)(rand()%x) using namespace std; int main() { srand((int)time(0));//部署随机种子 for (int i = 0; i < 10; i++){ cout << random(100) << endl; //输出0-100的随机数 }; return 0; }
【C++】 生成随机数
猜你喜欢
转载自blog.csdn.net/biongbiongdou/article/details/80065552
今日推荐
周排行