1 Star 0 Fork 115

fangcongss / CPlusPlusThings

forked from Yj / CPlusPlusThings 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
重载圆括号的时钟.cpp 482 Bytes
一键复制 编辑 原始数据 按行查看 历史
light-city 提交于 2020-04-06 00:57 . update
#include <iostream>
using namespace std;
class Time{
private:
int hh,mm,ss;
public:
Time(int h=0,int m=0,int s=0):hh(h),mm(m),ss(s){}
void operator()(int h,int m,int s) {
hh=h;
mm=m;
ss=s;
}
void ShowTime(){
cout<<hh<<":"<<mm<<":"<<ss<<endl;
}
};
int main(){
Time t1(12,10,11);
t1.ShowTime();
t1.operator()(23,20,34);
t1.ShowTime();
t1(10,10,10);
t1.ShowTime();
system("pause");
}
C++
1
https://gitee.com/fangcongss/CPlusPlusThings.git
git@gitee.com:fangcongss/CPlusPlusThings.git
fangcongss
CPlusPlusThings
CPlusPlusThings
master

搜索帮助