给你一段程序,是别人教我的: #include <stdlib.h> #include <stdio.h> #include <time.h> int main(void) { int i; time_t t; srand((unsigned) time(&t)); printf("Ten random numbers from 0 to 20
"); for(i=0; i<10; i++) printf("%d ", rand() % 20); return 0; }