#include <iostream> #include <ctime> #include <cstdlib> //产生100以内的随机数 int main() { srand((unsigned)time(NULL)); for (int i = 0; i < 10; ++i) { cout << rand() % 100 << end; } }