为了账号安全,请及时绑定邮箱和手机立即绑定

初学者问一道C++的改写题目

初学者问一道C++的改写题目

C++
掌门飞哥 2016-09-16 10:45:31
#include <iostream>using namespace std;class Time{public: int hour; int minute; int sec;};int main(){ Time t1; cin >> t1.hour; cin >> t1.minute; cin >> t1.sec; cout << t1.hour << ":" << t1.minute << ":" << t1.sec; return 0;}将上述C++程序改写为:1:将数据成员改为私有的2:将输入和输出的功能改为由成员函数实现3:在类体内定义成员函数谢谢了!
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 1863 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信