#include<stdio.h>
#include<stdlib.h>#include<time.h>void main()
{ time_t ts; srand((unsigned int)time(&ts)); int a[10]; for (int i = 0; i < 10; i++) { a[10] = rand() % 100; printf("\n%d,%x",a[10],&a[10]); } int all = 0; double total = 0.0; for (int i = 0; i < 10; i++) { all += a[10];}
total = all; total /= 10; printf("\n和=%d,平均值=%f", all, total); getchar();}