lasd/teoria/esempi_professore/examples/psecasgen/main.cpp

27 lines
615 B
C++
Raw Permalink Normal View History

2021-03-21 00:41:19 +01:00
#include <iostream>
// Random generation a la C
#include <stdlib.h>
#include <time.h>
// // Random generation a la C++
// #include <random>
using namespace std;
int main() {
// Random generation a la C
srand(time(NULL));
for(uint i = 0; i < 15; i++) { cout << rand() << " "; }; cout << endl;
// for(uint i = 0; i < 15; i++) { cout << rand() % 25 << " "; }; cout << endl;
// // Random generation a la C++
// default_random_engine gen(random_device{}());
// uniform_int_distribution<uint> dist(7, 35);
// for(uint i = 0; i < 15; i++) { cout << dist(gen) << " "; }; cout << endl;
return 0;
}