Facebook
From Gamboge Marmoset, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 112
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. class Punkt
  8. {
  9.     double x, y;
  10. public:
  11.     Punkt(double x, double y)
  12.     {
  13.         this->x=x;
  14.         this->y=y;
  15.     }
  16. };
  17.  
  18. class Kolo
  19. {
  20.     double r;
  21.     Punkt *srodek;
  22. public:
  23.     Kolo(double x, double y, double r)
  24.     {
  25.         srodek = new Punkt(x,y);
  26.         this->r=r;
  27.  
  28.     }
  29.     void pokaz()
  30.     {
  31.         cout << " x="<< srodek->x;
  32.     }
  33.  
  34. };
  35.  
  36. int main()
  37. {
  38.     Kolo k1(10,5,9);
  39.  
  40.     k1.pokaz();
  41.     return 0;
  42. }