当前位置: 首页 > news >正文

专门做期货的网站百度网站制作

专门做期货的网站,百度网站制作,制作表白网站,猪八戒网建设网站2500然后她叫我弄500.另外在给他2000目录 一&#xff1a;C语言中的随机数 二&#xff1a;C中的随机数 1. 生成随机数的例子 2. 随机数引擎 3. 随机数引擎适配器 4. C中预定义的随机数引擎&#xff0c;引擎适配器 5. 随机数分布 一&#xff1a;C语言中的随机数 <stdlib.h>//初始化随机种子 srand(static_ca…

目录

一:C语言中的随机数

二:C++中的随机数

    1. 生成随机数的例子

    2. 随机数引擎

    3. 随机数引擎适配器

    4. C++中预定义的随机数引擎,引擎适配器

    5. 随机数分布


一:C语言中的随机数

<stdlib.h>//初始化随机种子
srand(static_cast<unsigned int>(time(nullptr)));//生成随机数
cout << rand() << endl;//生成一个区间的内随机数(min, max)
return static_cast<int>(rand() % (max + 1UL - min)) + min;//生成100内随机数
int num = rand() % 100;//生成1-100内随机数
int num = rand() % 100 + 1;

二:C++中的随机数

    1. 生成随机数的例子
include <random>
#include <map>
#include <iostream>int main()
{static const int NUM = 1000000;//第一步 产生随机种子std::random_device seed;//第二步:使用随机数引擎生成器std::mt19937 gen(seed());//第三步:为随机数选择一种分布,此处选择均匀分布std::uniform_int_distribution<> uniformDist(0, 20); // min= 0; max= 20for (int i = 1; i <= NUM; ++i) {std::cout << uniformDist(gen) << " ";}
}
    2. 随机数引擎
引擎说明
random_device真随机数(非基于软件生成器),通常用来产生随机种子
linear_congruential_engine线性同余法生成器
mersenne_twister_engine梅森素数法生成器
subtract_with_carry_engine带进位减法随机数生成器
    3. 随机数引擎适配器
template<class Engine, size_t p, size_t r> class discard_block_engine {...}
template<class Engine, size_t w, class UIntT> class independent_bits_engine {...}
template<class Engine, size_t k> class shuffle_order_engine {...}
    4. C++中预定义的随机数引擎,引擎适配器

  5. 随机数分布
template<class IntType = int> class uniform_int_distribution
uniform_int_distribution(IntType a = 0, IntType b = numeric_limits<IntType>::max());template<class RealType = double> class uniform_real_distribution
uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);class bernoulli_distribution
bernoulli_distribution(double p = 0.5);template<class IntType = int> class binomial_distribution
binomial_distribution(IntType t = 1, double p = 0.5);template<class IntType = int> class geometric_distribution
geometric_distribution(double p = 0.5);template<class IntType = int> class negative_binomial_distribution
negative_binomial_distribution(IntType k = 1, double p = 0.5)template<class IntType = int> class poisson_distribution
poisson_distribution(double mean = 1.0);template<class RealType = double> class exponential_distribution
exponential_distribution(RealType lambda = 1.0);template<class RealType = double> class gamma_distribution
gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);template<class RealType = double> class weibull_distribution
weibull_distribution(RealType a = 1.0, RealType b = 1.0);template<class RealType = double> class extreme_value_distribution
extreme_value_distribution(RealType a = 0.0, RealType b = 1.0);template<class RealType = double> class normal_distribution
normal_distribution(RealType mean = 0.0, RealType stddev = 1.0);template<class RealType = double> class lognormal_distribution
lognormal_distribution(RealType m = 0.0, RealType s = 1.0);template<class RealType = double> class chi_squared_distribution
chi_squared_distribution(RealType n = 1);template<class RealType = double> class cauchy_distribution
cauchy_distribution(RealType a = 0.0, RealType b = 1.0);template<class RealType = double> class fisher_f_distribution
fisher_f_distribution(RealType m = 1, RealType n = 1);template<class RealType = double> class student_t_distribution
student_t_distribution(RealType n = 1);template<class IntType = int> class discrete_distribution
discrete_distribution(initializer_list<double> wl);template<class RealType = double> class piecewise_constant_distribution
template<class UnaryOperation>piecewise_constant_distribution(initializer_list<RealType> bl,
UnaryOperation fw);template<class RealType = double> class piecewise_linear_distribution
template<class UnaryOperation>piecewise_linear_distribution(initializer_list<RealType> bl,
UnaryOperation fw);

http://www.ds6.com.cn/news/115569.html

相关文章:

  • 做网站的多少钱数据分析师培训需要多少钱
  • 网站建设图seo的外链平台有哪些
  • 云网站注册网站免费建站app
  • 做网站的资源有哪些请输入搜索关键词
  • 专门做衣服特卖的网站关键词投放
  • 网站建设流程包括国家认可的教育培训机构
  • 长沙哪里做网站好快手seo软件下载
  • 任丘做网站价格seo外链发布平台
  • 今日猪价涨跌表今天猪价表北京官网seo
  • 评价一个网站的好坏广告软文代理平台
  • 沈阳网站建设找思路正版seo搜索引擎
  • 网站信用认证可以自己做吗关键词推广软件
  • 中国站长工具深圳网络推广代理
  • 做一小说网站要花多钱最有效的推广方式
  • 杭州精品课程网站建设德州seo优化
  • 网站建设的成果怎么写上海做关键词推广企业
  • ssr网站怎么做谷歌浏览器免费入口
  • 哈尔滨网站建设服务优秀营销软文范例300字
  • 自学网站建设要多久百度官网电话
  • 做移动网站优化快速东莞seo公司
  • 北京网站设计引流微信hyhyk1高端营销型网站制作
  • 微软做网站的软件免费外网加速器
  • 做网站的合同东莞做网站哪里好
  • 国外网站建设平台百度推广登录手机版
  • 怎么做家政的网站怎么做优化
  • 网站备案 公司名称关联性教程推广优化网站排名
  • 企业所得税政策最新2023上海搜索引擎优化公司
  • 个人可以做公益网站吗泰州seo外包
  • 我有网站 怎么做淘宝推广的sem是什么职位
  • 做的网站空白了网络营销策略研究论文