int main()
{
int arr[3][4]={0};
int sum=0;
int i=0;
int j=0;
double ave=0.0;
srand(time(NULL));
for(i=0;i<3;i++)
{
ave=0;
for(j=0;j<4;j++)
{
arr[i][j]=rand()%20+1;
printf("%d ",arr[i][j]);
ave+=arr[i][j];
}
ave/=4;
printf("ave:%.2f\n",ave);
}
标签:各行,二元,int,double,sum,srand,arr,NULL,平均值
From: https://blog.51cto.com/u_16190077/7040211