Advertisement
Josif_tepe

Untitled

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