⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch16_06.cpp

📁 在文件中含有大量基础C program code以公初学者参考
💻 CPP
字号:
#include <iostream>
using namespace std;
template <class type>
class cube
{
  private:
        type length;
        type width;
        type height;
        type volume;
  public:
        void set_length(type len)
        {
            length = len;
        }
        void set_width(type wid)
        {
            width = wid;
        }
        void set_height(type hei)
        {
            height = hei;
        }
        void calculate();
        void show_volume();
};
//---------------------------------
template <class type>
void cube<type>::calculate()
{
    volume = length*width*height;
}
//---------------------------------
template <class type>
void cube<type>::show_volume()
{
    cout<<"

⌨️ 快捷键说明

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