#include <iostream>
class Test {
int x, y;
public:
Test() = default;
Test(int a, int b) : x(a), y(b) {}
void print() const {
std::cout << "x = " << x << " y = " << y << "\n";
}
};
int main() {
Test *arr = new Test[5];
for (int i = 0; i < 5; i++) {
arr[i] = Test(i + 3, i + 10);
}
for (int i = 0; i < 5; i++) {
arr[i].print();
}
return 0;
}
/*
run:
x = 3 y = 10
x = 4 y = 11
x = 5 y = 12
x = 6 y = 13
x = 7 y = 14
*/