#include
#define N 5
int main()
{
int a[N][N];
int i,j,min;
int arr[N],*pp;
for(i=0;ifor(j=0;j scanf("%d",&a[i][j]); //输入元素
for(pp=arr,i=0;i{
min=a[i][0];
for(j=0;j{
if(min>a[i][j])
min=a[i][j];
}
*(pp+i)=min;
}
for(i=0;iprintf("%d ",*(pp+i)); //输出二维数组每行中最小元素
printf("\n");
return 0;
}
示例运行结果:
1 2 3 4 5
6 7 8 9 10
12 11 13 14 15
22 23 21 25 26
32 33 31 36 35
1 6 11 21 31