c语言二维数组求最大值
1 #include<stdio.h>
2 int main()
3 {
4 int i,j,row=0,colum=0,max;
5 int a[3][4]={
{
1,2,3,4},{
9,8,7,6},{-10,10,-5,2}};
6 max=a[0][0];
7 for (i=0;i<=2;i++)
8 {
9 for (j=0;j<=3;j++)
10 {
11 if (a[i][j]>max)
12 {
13 max=a[i][j];
14 row=i;
15 colum=j;
16 }
17 }
18 }
19 printf("max=%d,row=%d,colum=%d",max,row,colum);
20 printf("
");
21
22 } 1 #include
上一篇:
通过多线程提高代码的执行效率例子
下一篇:
Spring学习——Spring事务
