C++相談室 part124 [無断転載禁止]©5ch.io
■ このスレッドは過去ログ倉庫に格納されています
0320デフォルトの名無しさん (JP 0H07-89Kw)
2016/04/30(土) 23:13:30.56ID:+bg/IZ99H#pragma once
#include <iostream>
#include <random>
-------------------------------
#include "stdafx.h"
using namespace std;
int main()
{
random_device rnd;
// メルセンヌ・ツイスター法による乱数発生
// mt19937 engine; // 32bitパソコン用
uniform_int_distribution<int> distribution( 0, 9 ) ; // 整数
// uniform_real_distribution<double> distribution (0.0, 9.9); // 実数
for(int i = 0 ; i!= 10 ; ++i) cout<<distribution(engine)<<endl ;
cout << endl<< "Press Enter!";
cin.get();
return 0;
}
VC++2015では毎回違う乱数が出るのに,TDM GCC(gcc5.1.0)では
同じ乱数しか出ない. gccのオプションSWの問題?
■ このスレッドは過去ログ倉庫に格納されています