init commit
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
|
||||
class A {
|
||||
private:
|
||||
int x;
|
||||
bool to_print;
|
||||
public:
|
||||
A() {
|
||||
x = 0;
|
||||
to_print = false;
|
||||
}
|
||||
|
||||
A(const A& a) {
|
||||
std::cin >> x;
|
||||
int t;
|
||||
std::cin >> t;
|
||||
x += t;
|
||||
to_print = true;
|
||||
}
|
||||
|
||||
~A() {
|
||||
if (to_print) {
|
||||
std::cout << x << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user