这是我找到的答案
\\
void display( const int [][ 4 ] );
int main()
{
int array1[ 4 ][ 4 ] = { 1, 2, 3 ,4, 2, 4, 6,8 ,3,6,9,12 ,4,8,12,16};
int array2[ 4][ 4 ] = { 2,4,6,8,4,8,12,16,6,12,18,24,8,16,24,32 };
int array3[ 4 ][ 4 ] = { 3,6,9,12,6,12,18,24,9,18,27,36,12,24,36,48} ;
cout << " " << endl;
display( array1 );
cout << "\n" << endl;
display( array2 );
cout << "\n" << endl;
display( array3 );
return 0;
}
void display( const int a[][ 4 ] )
{
for ( int i = 0; i <4; i++ )
{
for ( int j = 0; j < 4; j++ ){
cout << a[ i ][ j ] << ' ';
}
cout << endl;
}
}
\\
觉得我的答案有点奇怪 请各位来 赐教赐教
我是看书学的 |