c++ 面向对象例子

2021-06-21 17:06

阅读:478

标签:type   str   ble   ace   height   name   iostream   public   volume   

#include 

using namespace std;


typedef long int *pint32;


class Box {
public:
    double length;
    double breadth;
    double height;
};


int main() {

    Box box1;
    Box box2;

    double volume = 0.0;

    box1.height = 5.0;
    box1.length = 6.0;
    box1.breadth = 7.0;


    box2.height = 10.0;
    box2.length = 12.0;
    box2.breadth = 13.0;


    volume = box1.height * box1.length * box1.breadth;
    cout 

c++ 面向对象例子

标签:type   str   ble   ace   height   name   iostream   public   volume   

原文地址:https://www.cnblogs.com/niconico-girl/p/9682532.html


评论


亲,登录后才可以留言!