+ 4
How random function work?
anyone can explain to me how random function work?algorithm is enough
2 Antworten
+ 3
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main () {
srand(time(0));
for (int x = 1; x <= 1000; x++) { //change x
cout << 1 + (rand() % 1000) << endl; //you can change the range here above 1000 or watever you want
}
}
- 1
they do random things