#include <iostream>
using namespace std;
class MyClass {
int a, b;
public:
MyClass(int n, int m) {
a = n;
b = m;
}
int getA() {
return a;
}
int getB() {
return b;
}
};
int main()
{
MyClass ob[4][2] = {
MyClass(1, 2), MyClass(3, 4),
MyClass(5, 6), MyClass(7, 8),
MyClass(9, 10), MyClass(11, 12),
MyClass(13, 14), MyClass(15, 16)
};
int i;
for(i = 0; i <4; i++) {
cout << ob[ i ][0].getA() << ' ';
cout << ob[ i ][0].getB() << endl;
cout << ob[ i ][1].getA() << ' ';
cout << ob[ i ][1].getB() << endl;
}
cout << endl;
return 0;
}
|