Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- class cube {
- private:
- double side;
- double volume() {
- return pow(side, 3);
- }
- public:
- int n;
- void vvod() {
- cout << "Введите длину куба: ";
- cin >> side;
- cout << endl;
- }
- void vivod() {
- cout << "Объем куба: " << volume() << endl;
- cout << endl;
- }
- };
- int main() {
- cube c1, c2;
- cout << "Первый куб:" << endl;
- c1.vvod();
- c1.vivod();
- cout << "Второй куб:" << endl;
- c2.vvod();
- c2.vivod();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement