#include <iostream>
#include <boost/random.hpp>
using namespace std;
typedef boost::minstd_rand GenType;
typedef boost::normal_distribution<> NormalDis;
typedef boost::variate_generator<GenType&, NormalDis> RNG;
void Show(RNG& rng)
{
cout.setf(ios_base::fixed);
cout.precision(2);
for(int i = 0; i < 50;)
{
double temp = rng();
if(temp >= 1 && temp <= 100)
{
cout << temp << ' ';
if(++i % 5 == 0)
cout << '\n';
}
else
continue;
}
cout << endl;
}
int main()
{
GenType gt;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载
- 1
- 2
- 3
- 4
- 5
- 6
前往页