zoukankan      html  css  js  c++  java
  • c++11 随机代码记录

    // RadomTest.cpp : 定义控制台应用程序的入口点。
    //
    
    #include "stdafx.h"
    #include <iostream>
    #include <random>
    #include <time.h>
    
    using namespace std;
    
    int main()
    {
    
            std::default_random_engine random(time(NULL));
            std::uniform_int_distribution<int> dis1(0, 100);
        
    
            for (int i = 0; i < 10; ++i)
                cout << dis1(random) << endl;
            cout << endl;
            //==========================================
            std::random_device rd;
    
            std::default_random_engine e(rd());
    
            std::uniform_int_distribution <> u(0, 100);
    
            for (size_t i = 0; i < 10; i++) {
    
                cout << u(e) << endl;
    
            }
        
        
        return 0;
    }

    记录

  • 相关阅读:
    2016第50周五
    2016第50周四
    2016第50周三
    2016第50周二
    2016第50周一
    2016第49周日
    软件架构、框架、模式、模块、组件、插件概念汇总
    2016第49周五
    2016第49周四
    从服务器上共享文件上下载文件或上传文件
  • 原文地址:https://www.cnblogs.com/itdef/p/5002460.html
Copyright © 2011-2022 走看看