Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- class compute {
- private:
- static int a;
- public:
- static int get();
- static int get(int x);
- };
- int compute::a{};
- int compute::get() {
- return a;
- }
- int compute::get(int x) {
- return a = x;
- }
- int main() {
- cout << compute::get(3*4) << '\n';
- cout << compute::get() << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement