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

📄 main.cpp

📁 初学者用的关于VC继承思想的小程序,非常使用于初学者哦
💻 CPP
字号:
//************       main.cpp       *************

#include <iostream>
using namespace std;

#include "parallelogram.h"
#include "rectangle.h"
#include "square.h"

int main()
{
	//平行四边形时
	Parallelogram para( 2.3, 5.0, 30.0, "black" );
	para.print();
	cout << "The girth of parallelogram is: " << para.girth() << endl;
    cout << "The area of parallelogram is: " << para.area() << endl;
    cout << endl;

    //矩形
	REctangle rect( 2.0, 5.0, 90.0, "white" );
    rect.print();
	cout << "The girth of rectangle is: " << rect.girth() << endl;
    cout << "The area of rectangle is: " << rect.area() << endl;
    cout << endl;

	//正方形
	Square squa(2.0, 2.0, 90.0, "yellow");
	squa.print();
	cout << "The girth of square is: " << squa.girth() << endl;
	cout << "The area of square is: " << squa.area() << endl;
	cout << endl;

	return 0;
}

⌨️ 快捷键说明

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