标签:生成器 namespace ++ 随机数生成器 for 随机 unsigned com names
#include <iostream>
using namespace std;
#include   <stdlib.h>
#include   <time.h>
#define MIN 1    //随机数产生的范围
#define MAX 100000
int main()
{
    //freopen("data.out","w",stdout);
   // cout<<"100000 100000"<<endl;
    srand((unsigned)time(NULL));
    for(int i=1; i<=100000;i++)          //产生随机数
    {
        int a=MIN + rand() % (MAX + MIN - 1);
        int b=MIN + rand() % (MAX + MIN - 1);
        if(a>b)swap(a,b);
        cout<<a<<' '<<b<<endl;
    }
    cout<<endl;
    return   0;
}

标签:生成器 namespace ++ 随机数生成器 for 随机 unsigned com names
原文地址:https://www.cnblogs.com/GavinZheng/p/11235562.html