![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
Y425613
这个作者很懒,什么都没留下…
展开
-
设计一个类CRectangle
#includeusing namespace std;class CRectangle{public:void set_value();void display();CRectangle(){a = 1.0;b = 1.0;}private:float a, b;};void CRectangle::set_value(){cin >>a>>b;if (a > 50){a = 1.0;}else if(a<0){a = 1原创 2021-12-30 21:49:13 · 1261 阅读 · 0 评论 -
定义一个Date类
#include#include using namespace std;class Date{int year,month,day;public:Date(){}Date(int y,int m,int d){ year = y; month = m; day = d;}int GetDate(){ cout<<year<<"-"<<setw(2)<<setfill('0')<<month<<"-"原创 2021-12-30 21:44:38 · 398 阅读 · 0 评论