Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "math.h"
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- class koord
- {
- protected:
- double a, b;
- public:
- float vvod()
- {
- cout << "Koord X: " << endl;
- cin >> a;
- cout << "Koord Y: " << endl;
- cin >> b;
- return 0;
- }
- };
- class chislo : public koord
- {
- protected :
- double c;
- double S;
- public :
- double summa()
- {
- return S = (a + c)*(b + c);
- }
- };
- int main()
- {
- setlocale(0, "");
- koord* ko;
- chislo* ch = new chislo;
- ko->vvod();
- cout << " Summa = " << endl;
- ch->summa();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement