1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| # include<stdio.h> # include<stdlib.h> # include<time.h> # define MAX 10
int main(){ int j = 0; int i = rand(); int list[MAX]; srand((unsigned)time(NULL)); for(j = 0; j < MAX; j++){ i = rand()%100; list[j] = i; printf("%3d %c",list[j],5); } }
|