# include
# include
# include
using namespace std;
The class Myclass
{
Public:
Int x=0, y=0;
Myclass () {}
Void array ()
{
Int I=0, j=0;
Do
{
Cin & gt;> A, [I] [j]. J++; Y=j;
If (j % 3==0) {i++; X=I; }
} while (a [I] [j].=(EOF);
}
Myclass (int, int j)
{
Srand (int (time (0)));
For (int o=0; O{
For (int p=0; p
}
}
Myclass operator + (Myclass& None)
{
Myclass in;
for (int i=0; I & lt; x; I++)
{
For (int j=0; J & lt; y; J++)
{
In. C [I] [j] a [I] [j] + b=[I] [j];
}
}
Return in;
}
Void the show ()
{
For (int p=0; P & lt; x; P++)
{
For (int o=0; O & lt; y; O++)
{
Cout & lt;
Cout & lt;
}
Private:
B int a [20] [20], [20] [20], c [20] [20].
};
Int main ()
{
Myclass one;
Cout & lt; <"Both please input one array:" & lt;
Myclass three; Three=one + two; Three. The show ();
return 0;
}
CodePudding user response:
Seemingly matrix addition, a large number of data input, can be redirected from a text file input, reduce duplication of work,CodePudding user response:
What is not the result