知識社群登入
位置: AutoCAD開放式教學 > 討論區 > 討論
VC6 X 20 set , OK
1樓
    9171
    6105
   22820
   30945
   31677
   26140
   17050
   15621
   13827
    2681
Press any key to continue


/* RAND.C: This program seeds the random-number generator
* with the time, then displays 10 random integers.
*/

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

void main( void )
{
int i;
/* Seed the random-number generator with current time so that
    * the numbers will be different every time we run.
    */
srand( (unsigned)time( NULL ) );
/* Display 10 numbers. */
for( i = 0;   i < 10;i++ )
printf( "  %6d\n", rand() );
}