Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <string>
- #include <iostream>
- using namespace std;
- class Electrolysis
- {
- float I, k, t;
- public:
- Electrolysis()
- {
- cout << "Введите I: "; cin >> I;
- cout << "Введите k: "; cin >> k;
- cout << "Введите t: "; cin >> t;
- }
- ~Electrolysis()
- {
- cout << "Тут сработал деструктор!\n";
- }
- void Change(float I, float k, float t)
- {
- this->I = I;
- this->k = k;
- this->t = t;
- }
- float CalcMass()
- {
- return I*k*t;
- }
- };
- int main()
- {
- setlocale(LC_ALL, "rus");
- Electrolysis *el = new Electrolysis();
- float m = el->CalcMass();
- cout << "m=" << m << " кг\n";
- delete el;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement