皮皮学,免费搜题
登录
搜题
【简答题】
可以将下例 3. 13程序中的 display 函数不放在 Time 类中,而作为类外的普通函数,然后分别在 Time 和 Date 类中将 display 声明为朋友。在主函数中调用 display 函数, display 函数分别引用 Time 和 Date 两个类的对象的私有数据,输出年、月、日和时、分、秒。 //例3.13 #include < iostream > using namespace std ; class Date; class Time {public: Time( int,int,int ); void display(Date &); private: int hour; int minute; int sec; }; class Date {public: Date( int,int,int ); friend void Time::display(Date &); private: int month; int day; int year; }; Time::Time( int h,int m,int s) { hour= h;minute = m;sec =s; } void Time::display(Date &d) { cout << d.month <<"/"<< d.day <<"/"<< d.year << endl ; cout < <<":"< <<":"< << endl ; } Date::Date( int m, int d,int y) { month= m;day = d;year =y; } int main( ) { Time t1(10,13,56); Date d1(12,25,2004); t1.display(d1); return 0; }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【多选题】导致配载效率低下的因素有( )
A.
配载优化技术不成熟
B.
配载时间制约
C.
订单波动,带来多次重复计算
D.
货物基础数据不准确
【单选题】本线路限时电流速断保护的保护范围一般不超过相邻下一条线路的( )的保护范围。
A.
瞬时电流速断保护
B.
限时电流速断保护
C.
定时限过电流保护
【单选题】在gis空间分析里边,哪个不是空间分析的数据模型()
A.
栅格数据模型
B.
矢量数据模型
C.
时空数据模型
D.
金字塔数据模型
【简答题】本线路的限时电流速断保护的保护范围不应____下一线路的无时限电流速断保护的保护范围。
【单选题】以下( )种做法不能提高齿轮传动的齿面接触承载能力。
A.
d不变而增大模数
B.
改善材料
C.
增大齿宽
D.
增大齿数以增大d
【判断题】MCS_51单片机P3端口的各端口线如果作为第二功能信号使用的话,那么它们就不能再用来进行数据I/O传送;同样道理,如果用作数据传送,就不能再作为第二功能信号使用。
A.
正确
B.
错误
【简答题】本线路限时电流速断保护的保护范围一般不超过相邻下一线路的()保护的保护范围,故只需带()延时即可保 证选择性。
【单选题】以下()种做法不能提高齿轮传动的齿面接触承载能力。
A.
直径不变而模数增大
B.
改善材料
C.
增大齿宽
D.
增大齿数以增大直径
【单选题】What's the news report mainly about?
A.
The New York Public Library.
B.
Spanish immigrants.
C.
Pura Belpre and her influence.
D.
Belen Garcia and her library.
【简答题】磷的测定方法很多,食品中磷的含量较高时采用 测定,如果磷含量很低应采用 测定。
相关题目: