0
#include <iostream> #include <cstdlib> using namespace std; int main() { cout << rand(); } output = 41 Why this code code gi
3 Respostas
+ 15
@Jay is correct. You need to randomise your seed for RNG. One of the most common ways is to use system time.
#include <iostream>
#include <cstdlib>
#include <ctime>
int main()
{
srand(time(0));
std::cout << rand();
return 0;
}
+ 9
use description....
https://www.sololearn.com/discuss/281118/?ref=app
+ 7
you need to seed?