7_1.cpp

来自「《c++语言程序设计》第二版 郑莉」· C++ 代码 · 共 18 行

CPP
18
字号
//7_1.cpp
#include<iostream>
#include<cmath>
#include "rectangle.h"
using namespace std;
void main()
{
	Rectangle rect;	//声明Rectangle类的对象
	rect.InitR(2,3,20,10);	//设置矩形的数据
	rect.Move(3,2);	//移动矩形位置
	cout<<"The data of rect(X,Y,W,H):"<<endl;
	cout<<rect.GetX()<<","	//输出矩形的特征参数
	      <<rect.GetY()<<","
	      <<rect.GetW()<<","
	      <<rect.GetH()<<endl;
}
//End of 7_1.cpp

⌨️ 快捷键说明

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