把副程式 放在主程式的 外面
(高顯忠, sjgau4311@gmail.com, 2010-12-22 11:29)
1樓
// file name: rand-02.cpp
#include "sj-01.h"
#include "sj-02.h"
// ----------------------------------------------
using namespace std;
// ----------------------------------------------
#if 0
#endif
// ----------------------------------------------
int main(int argc, char *argv[])
{
int i;
time_t t1;
for (;;) {
// srand((unsigned) time(&t1) );
// printf("t1= %d, year= %.3lf\n\n", t1, ((((double) t1)/86400.0/365.25) + 1970));
init_rand();
for( i = 0; i < 10;i++ ) {
printf( " %6d\n", rand1()%1000);
}
system("PAUSE");
}
return EXIT_SUCCESS;
}// end of main()