Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. class Electrolysis
  7. {
  8. float I, k, t;
  9. public:
  10. Electrolysis()
  11. {
  12. cout << "Введите I: "; cin >> I;
  13. cout << "Введите k: "; cin >> k;
  14. cout << "Введите t: "; cin >> t;
  15. }
  16. ~Electrolysis()
  17. {
  18. cout << "Тут сработал деструктор!\n";
  19. }
  20. void Change(float I, float k, float t)
  21. {
  22. this->I = I;
  23. this->k = k;
  24. this->t = t;
  25. }
  26. float CalcMass()
  27. {
  28. return I*k*t;
  29. }
  30. };
  31.  
  32. int main()
  33. {
  34. setlocale(LC_ALL, "rus");
  35. Electrolysis *el = new Electrolysis();
  36. float m = el->CalcMass();
  37. cout << "m=" << m << " кг\n";
  38. delete el;
  39. system("pause");
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement