Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Enter a matrix with three rows and four columns and find the average of all elements (plastic, two-dimensional array).
Enter a matrix with three rows and four columns and find the average of all elements (plastic, two-dimensional array).
I haven't written C for a long time, which is not very standard. Hehe

# include <; stdio.h>

main()

{

int a[3][4];

int i;

int j;

printf ("Enter the number of three rows and four columns: \n");

for(int i=; i< 3; i++)

{

for(int j=; j< 4; j++)

scanf("%d",a[i][j]);

}

int sum=;

for(i=; i< 3; i++)

for(j=; < j< 4; j++)

sum=sum+a[i][j] ;

int b=;

b=sum/12;

printf ("Please output average: \n%3d",b);

}