fork(1) download
  1. #include <iostream>
  2. #include <random>
  3. using namespace std;
  4.  
  5. int main() {
  6. default_random_engine generator;
  7. uniform_int_distribution<int> distribution(0, 4000000);
  8. double populacao[10];
  9. double aptidao[10];
  10. for (int i = 0; i<10; i++) {
  11. populacao[i] = distribution(generator);
  12. cout << populacao[i] << endl;
  13. aptidao[i] = populacao[i];
  14. }
  15. }
  16.  
  17. //https://pt.stackoverflow.com/q/229597/101
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
31
527006
3.02733e+06
1.83758e+06
2.13453e+06
877259
188484
2.71987e+06
2.7216e+06
3.74485e+06