Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - A 3×4 integer array A is known, and the sum of the elements in each column in the array is taken as the elements in b[4] respectively.
A 3×4 integer array A is known, and the sum of the elements in each column in the array is taken as the elements in b[4] respectively.
# Contains? & ltstdio.h & gt

int? main()? {

int? Answer [3][4]? =? {{ 1,2,3,4},{2,3,4,5},{3,4,5,6}};

int? b[4],I,j;

For (me? =? 0; ? Me? & lt? 4; ? ++i)? {

b[i]? =? 0;

For (j? =? 0; ? j? & lt? 3; ? ++j)? b[i]? +=? a[j][I];

}

For (me? =? 0; ? Me? & lt? 3; ? ++i)? {

For (j? =? 0; ? j? & lt? 4; ? ++j)

printf("%3d ",a[I][j]);

printf(" \ n ");

}

printf(" \ n ");

For (me? =? 0; ? Me? & lt? 4; ? ++i)? printf("%3d ",b[I]);

printf(" \ n ");

Return? 0;

}