#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main () {
int i, n;
time_t t;
n = 5;
/* Intializes random number generator */
srand((unsigned) time(&t));
/* Print 5 random numbers from 0 to 50 */
for( i = 0 ; i < n ; i++ ) {
printf("%d/n", rand() % 50);
}
return(0);
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265261.html