The rand function returns a pseudorandom integer in the range 0 to RAND_MAX (32767). Use the srand function to seed the pseudorandom-number generator before calling rand.
srand(time);
double temp = rand()/32767.0;
long mark = temp * 100 0000;
================================
mark 作为下标,去取数就可以了。