生成10个1-10000的随机数转换成字符输出
#include<iostream>
#include<string>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
srand((unsigned)time(0));
string temp;
for (int i = 0; i < 10; i++)
{
int x = rand() % 1000000 + 1;
temp = to_string(x);
cout << temp << endl;
}
}