#include
#define M 2
#define N 4
int main()
{
int sumcolummin(int a[N]);
int x[M][N]={3,2,5,1,4,1,8,3},s,i,j,min[N];
for(j=0;j
min[j]=x[0][j];
for(i=0;i
if(x[i][j]
}
printf("min[%d]=%d\n",j,min[j]);
}
s=sumcolumin(min);
printf("s=%d\n",s);
}
int sumcolumin(int a[N])
{
int j,sum=0;
for(j=0;j
sum=sum+a[j];
}
return(sum);
}
#include "stdio.h"
#define M 2
#define N 4
void SumColumMin(int a[M][N],int *sum)
{
int j,min;
*sum = 0;
for(int i = 0;i < N;i++)
{
min = a[0][i];
for(j = 0;j < M;j++)
if (min > a[j][i])
min = a[j][i];
*sum = *sum + min;
}
}
void main()
{
int x[M][N]={3,2,5,1,4,1,8,3},s;
SumColumMin(x,&s);
printf("%d\n",s);
}