rect.cpp

来自「高等教育出版社出版的C++程序设计同步实验范例 希望对用这本教材得同学有点帮助」· C++ 代码 · 共 19 行

CPP
19
字号
#include <iostream.h>
#include <rect.h>
// 构造函数,带缺省参数,缺省值为全0
Rectangle::Rectangle(int l, int t, int r, int b) {
	left = l; top = t;
	right = r; bottom = b; 
}
void Rectangle::Assign(int l, int t, int r, int b){
	left = l; top = t;
	right = r; bottom = b;
}
void Rectangle::Show(){
	cout<<"left-top point is ("<<left<<","<<top<<")"<<'\n';
	cout<<"right-bottom point is ("<<right<<","<<bottom<<")"<<'\n';
}
//void Rectangle::Draw(CDC * pDC){ 
//pDC->Rectangle(left, top, right, bottom ); 
//}

⌨️ 快捷键说明

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