+ 2
this is ridiculous rand() operator
this code always shows just these numbers: 41 18467 6334 26500 19169 15724 11478 29358 26962 24464 i thought that this code shows really random numbers. https://code.sololearn.com/cff0MFWq908q/#cpp
2 odpowiedzi
+ 4
To get truly random numbers you have to give a random seed
Use:
#include <ctime>
then
srand(time(0));
That uses the current time(which constantly changes) as the seed making the generator more random
+ 1
thanks for ur answer dear Yerucham
https://code.sololearn.com/clBV7RSf30Bd/#cpp