Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "math.h"
  3. #include <iostream>
  4. #include <stdio.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. class koord
  10. {
  11. protected:
  12.     double a, b;
  13. public:
  14.     float vvod()
  15.     {
  16.         cout << "Koord X: " << endl;
  17.         cin >> a;
  18.         cout << "Koord Y:  " << endl;
  19.         cin >> b;
  20.         return 0;
  21.     }
  22. };
  23.  
  24. class chislo : public koord
  25. {
  26. protected :
  27.     double c;
  28.     double S;
  29. public :
  30.     double summa()
  31.     {
  32.         return S = (a + c)*(b + c);
  33.     }
  34.  
  35. };
  36.  
  37. int main()
  38. {
  39.     setlocale(0, "");
  40.     koord* ko;
  41.     chislo* ch = new chislo;
  42.     ko->vvod();
  43.     cout << " Summa = " << endl;
  44.     ch->summa();
  45.     system("pause");
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement