<stdlib.h>
has a land()
function.
Return the integer from 0
to RAND_MAX
at random.
I need to be careful when I use it
rand()
Actually, it's not completely random, but it's implemented in a way that returns the integers that are already randomly listed
You need to set seed to get a different number each time you run it.
Required for #include <time.h> //seed
#include <stdlib.h>
srand(time(NULL); //seedWrite
int r = rand();
© 2024 OneMinuteCode. All rights reserved.