Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Ct
- {
- public:
- int u;
- int aMatrix[3][3];
- char sz[123];
- Ct()
- {
- cout << "Enter 9th int:";
- for(int i = 0; i < 3; i++)
- {
- for(int j = 0; j < 3; j++)
- {
- cin >> aMatrix[i][j];
- }
- }
- }
- void pr()
- {
- cout << endl;
- for(int i = 0; i < 3; i++)
- {
- for(int j = 0; j < 3; j++)
- {
- cout << aMatrix[i][j] <<" ";
- }
- cout << endl;
- }
- }
- };
- int check(Ct *p);
- ////////////////////////////////////////////////////////////////
- int main() //
- {
- cout << "Enter the elements of the 1st matrix:\n";
- Ct t1;
- cout << "Enter the elements of the 2st matrix:\n";
- Ct t2;
- if(check(&t1) == 1)
- {
- t1.pr();
- cout << endl;
- t2.pr();
- }
- else
- {
- t2.pr();
- cout << endl;
- t1.pr();
- }
- return 0;
- }
- /////////////////////////////////////////////////////////////////
- int check(Ct *p) //
- {
- if(p->aMatrix[0][0] == 1) return 1;
- return 0;
- }
- /*
- #include <iostream>
- using namespace std;
- struct Ct
- {
- int u;
- char sz[123];
- Ct()
- {
- }
- void print()
- {
- cout << "u = " << u;
- }
- }t1, t2;
- ////////////////////////////////////////////////////////////////
- int main() //
- {
- Ct t3,
- t4;
- t1.u = 12;
- t1.print();
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement