boxes2.cpp

来自「Since the field of object oriented progr」· C++ 代码 · 共 29 行

CPP
29
字号
                                // Chapter 5 - Program 9 - BOXES2.CPP
#include <iostream.h>
#include "box.h"

int main()
{
box small, medium, large;          //Three boxes to work with

   small.set(5, 7);
                          // Note that the medium box uses the values
                          // supplied by the constructor
   large.set(15, 20);
   
   cout << "The small box area is " << small.get_area() << "\n";
   cout << "The medium box area is " << medium.get_area() << "\n";
   cout << "The large box area is " << large.get_area() << "\n";

   return 0;
}




// Result of execution
//
// The small box area is 35
// The medium box area is 64
// The large box area is 300

⌨️ 快捷键说明

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