Home > Back-end >  C
C

Time:09-30

//============================================================================
//Name: wh188. CPP
//the Author:
//Version:
//Copyright: Your Copyright notice
//Description: Hello World in c + +, Ansi - style
//============================================================================

#include
using namespace std;
The class MATRIX
{
Int m;
int sum;
Int a [40] [40].
Public:
MATRIX (int x [] [40], int k)
{
M=k;
for(int i=0; I{
For (int j=0; JA [I] [j]=x [I] [j];
}
sum=0;
}
Void the process ();
Void the show ()
{
for(int i=0; I{
For (int j=0; JCoutCout}
Cout<& lt;" Sum="& lt; }
};
Void MATRIX: : process ()
{
int i,j;
for(i=0; I{
for(j=0; I{
If ((I==j) | | ((I + j)==(m - 1)))
continue;
The sum +=a, [I] [j].
}
}
}
Int main ()
{
Int b [40] [40]={{1,1,1,1}, {1,2,2,1}, {1,2,2,1}, {1,1,1,1}};
MATRIX MTX (b, 4);
MTX. The process ();
MTX. The show ();
return 0;
}
This program is run said exe stop work is why?

CodePudding user response:

May be what's the exception, debugging see where wrong

CodePudding user response:

 
Void MATRIX: : process ()
{
int i,j;

for(i=0; I{
//for (j=0; Ifor(j=0; J{
If ((I==j) | | ((I + j)==(m - 1)))
continue;
The sum +=a, [I] [j].
}
}
}