for(i=0;i<h;i++)
{
srand(time(0));
b[i]=rand()%3;
}
在这个循环中b[i]不变 怎样才能让它变化?
天蓬老师2017-04-17 15:19:23
b[i] must not change in the loop, because you will initialize PRNG every time you loop. srand(time(0));
should be placed outside the loop.