1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include <math.h>
#include <stdio.h>
#include <cstdlib>
#include <iostream>
using namespace std;
void testfunction(int M[6][6]);
int main (){
int M[6][6]={{1,2,3,4,5,6},
{2,3,4,5,6,7},
{9,8,7,6,5,4},
{3,4,5,6,7,8},
{3,5,4,6,7,8},
{2,3,4,7,6,5}, };
testfunction(M);
return 0;
}
void testfunction(int M[6][6]){
for (int i=1; i<6; i++){
for (int j=1; j<6; j++){
if (i==j){
M[i][j]=3;
printf("i= %d j= %d M_ij= %d\n",i,j,M[i][j]);
} else{
M[i][j]=2*M[i][j];
printf("i= %d j= %d M_ij= %d\n",i,j,M[i][j]);
}
}
}
}
|