Advertisement
Josif_tepe

Untitled

Oct 13th, 2023
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. class Point {
  7. public:
  8.     int x;
  9.     int y;
  10.    
  11.    
  12.     void soberi(int x_tmp, int y_tmp) {
  13.         x += x_tmp;
  14.         y += y_tmp;
  15.     }
  16.    
  17. };
  18. int main() {
  19.    
  20.     Point p;
  21.     cin >> p.x >> p.y;
  22.    
  23.     p.soberi(4, 5);
  24.    
  25.     cout << p.x << " " << p.y << endl;
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement