The definition of a two-dimensional array of inverted function

#include <stdio.h>
 // define a 3 * 3 array of the inverse function 
void Fan ( int A [ 3 ] [ 3 ]) {
 int I, J;
 int T [ 3 ] [ 3 ];
 for (I = 0 ; I < . 3 ; I ++ )
     for (J = 0 ; J < . 3 ; J ++ ) 
    T [I] [J] = A [J] [I];
 for (I = 0 ; I < . 3 ; I ++ ) {
     for ( = J 0 ; J < . 3 ; J ++ ) 
    the printf (" % D " , T [I] [J]); 
    the printf ( " \ n- " ); 
    } 
    return  0 ; 
} 
// verify 
int main () {
 int A [ . 3 ] [ . 3 ], I, J;
 the while ( . 1 ) { 
the printf ( " Please sequentially input source array elements \ n- " );
 for (I = 0 ; I < . 3 ; I ++ )
 for (J = 0 ; J < . 3 ; J ++ ) 
Scanf ( " % D " , &A [I] [J]); 
the printf ( " reversed after the array is: \ n- " ); 
Fan (A); 
} 
return  0 ; 
}   
    

 

Guess you like

Origin www.cnblogs.com/gougouwang/p/11515495.html