又是我了~~大家帮忙;
#include "stdio.h"void display (int array[3][5]){
int r, c;
for ( r = 0; r < 3; ++r ) {
for ( c = 0; c < 5; ++c )
printf ( "%5i", array[r][c] );
printf ("\n");
}
}
void m2 (int array[3][5], int scale ) {
int r, c;
for ( r = 0; r < 3; ++r )
for ( c = 0; r < 5; ++c )
array [r][c] *= scale;
}
int main(void)
{
void display (int array[3][5]);
void m2 (int array[3][5], int scale );
int tarray [3][5] = {
{ 7, 24, 54, 12, 1 },
{ 2, 6, 87, 61, 41 },
{ 8, 10, 64, 42, 62 }
};
printf ("origange digit.\n");
display ( tarray );
m2 ( tarray, 2 );
printf ("\nmumtiply by 2:\n");
display ( tarray );
m2 ( tarray, -1 );
printf ("\nmuntiply by -1:\n");
display ( tarray );
return 0;
}