prog12_07.cpp

来自「c++最经典的入门书籍」· C++ 代码 · 共 29 行

CPP
29
字号
// Program 12.7 Using the this pointer   File: prog12_07.cpp
#include <iostream>
#include "Box.h"

using std::cout;
using std::endl;

int main() {
  cout << endl;

  Box firstBox(17.0, 11.0, 5.0);
  Box secondBox(9.0, 18.0, 4.0);

  cout << "The first box is "
       << (firstBox.compareVolume(secondBox) >= 0 ? "" : "not ")
       << "greater than the second box."
       << endl;

  cout << "Volume of first box = "
       << firstBox.volume()
       << endl;

  cout << "Volume of second box = "
       << secondBox.volume()
       << endl;

  return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?