#include <iostream> #include<ctime> using namespace std; int main() { //生成随机数 srand((unsigned int) time(NULL)); for (int i = 0; i < 10; ++i) { int num = rand() % 100 + 1; cout << num << endl; } return 0; }
47 94 27 59 65 65 62 1 69 89
#include <iostream> #include<ctime> using namespace std; int main() { //生成随机数 srand((unsigned int) time(NULL)); for (int i = 0; i < 10; ++i) { int num = rand() % 100 + 1; cout << num << endl; } return 0; }
47 94 27 59 65 65 62 1 69 89