關於 亂數 1111
(高顯忠, sjgau4311@gmail.com, 2010-12-22 11:11)
1樓
#include <cstdlib>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <time.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));
for( i = 0; i < 10;i++ ) {
printf( " %6d\n", rand());
}
system("PAUSE");
}
return EXIT_SUCCESS;
}// end of main()
// ----------------------------------------------