fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Punkt
  5. {
  6. int x,y;
  7. public:
  8. Punkt(int xx, int yy) : x(xx), y(yy){ }
  9. int getX(){ return x; }
  10. int getY(){ return y; }
  11. };
  12.  
  13. class Linia
  14. {
  15. Punkt p1, p2;
  16. public:
  17. Linia(int aa, int ab, int ba, int bb) : p1(aa, ab), p2(ba, bb){ }
  18. void wypisz(){ cout << p1.getX() << " " << p1.getY() << endl << p2.getX() << " " << p2.getY() << endl; }
  19. };
  20.  
  21. int main()
  22. {
  23. Linia(4, 3, 1, 4).wypisz();
  24. return 0;
  25. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
4 3
1 4