fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Point
  5. {
  6. public:
  7. void SetXY(int x, int y) { X = x; Y = y; }
  8. void print() { cout << "<" << X << "," << Y << ">" << endl; }
  9.  
  10. private:
  11. int X;
  12. int Y;
  13. };
  14.  
  15. int main()
  16. {
  17. int x, y;
  18. Point p1;
  19.  
  20. cout << "Please Input the X and Y : ";
  21. cin >> x >> y;
  22.  
  23. p1.SetXY(x, y);
  24. p1.print();
  25.  
  26. return 0;
  27. }
  28.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty