Advertisement
Josif_tepe

Untitled

Feb 19th, 2025
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Point {
  5.     int x, y;
  6.    
  7.     void init() {
  8.         x = 0;
  9.         y = 0;
  10.     }
  11.    
  12.     void input() {
  13.         cin >> x >> y;
  14.     }
  15.    
  16.     void output() {
  17.         cout << "X: " << x  << endl << "Y: " << y << endl;
  18.     }
  19.     int soberi() {
  20.         return x + y;
  21.     }
  22. };
  23.  
  24. int main()
  25. {
  26.    
  27.     Point p;
  28.     p.input();
  29.     cout << p.soberi() << endl;
  30.  
  31.     p.output();
  32.    
  33.     return 0;
  34. }
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement