Diagonal forming
Idea: Enter a 3*3 two-dimensional array A in the keyboard, then assume that a[0][0] is the maximum value, then compare a[0][0] with a[ 1][ 1] and A [2], and finally output the maximum value and the maximum number of rows.

Reference code:

# include & ltstdio.h & gt

# Definition? n? three

int? Master ()

{

int? a[n][n],I,j,max,maxi

for(I = 0; I & ltn;; I++)// Keyboard input?

for(j = 0; j & ltn; j++)

scanf("%d ",& ampa[I][j]); ?

max = a[0][0];

maxi = 0;

for(I = 1; I & ltn;; I++)// ergodic judgment?

if(max & lt; a[i][i])? {

max = a[I][I];

maxi = I;

}

Printf ("maximum value is %d, maximum number of rows is %d, \n", max, maxi);

Return? 0;

}

/*

1? 2? three

4? 6? five

7? 9? 2

The maximum value is 6 and the maximum number of rows is 1.

*/