Find the maximum number of array

 1 #include<stdio.h>
 2 int main()
 3 {
 4     int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 12 };        //设置数组
 5     int i, k,max,low,row;            
 6     max = 0;
 7     low = 0;
 8     Row = 0 ;
 . 9      for (I = 0 ; I <= 2 ; I ++)         // loop through the array 
10      {
 . 11          for (K = 0 ; K <= . 3 ; K ++ )
 12 is          {
 13 is              IF (A [I] [K ]> max)         // if it is large than mAX assignment 
14              {
 15                  Low = I;
 16                  Row = K;
 . 17                  max = A [I] [K];
 18 is              }
 . 19          }
 20 is     }
21     printf("%d\t%d\t%d", max, low, row);
22 
23     return 0;
24 }

 

Guess you like

Origin www.cnblogs.com/old-horse/p/12519671.html