题解 | #KiKi定义电子日历类#

KiKi定义电子日历类

http://www.nowcoder.com/practice/e4c67097cdb242d9a3f38b7cfe839396

很简单的题

using namespace std;
class TDate{
public:
    TDate(int a=0,int b=0,int c=0){
        this->year=a;
        this->mon=b;
        this->day=c;
    }
    void print(){
        cout<<day<<"/"<<mon<<"/"<<year<<endl;
    }
private:
    double year,mon,day;
};
void test(){
    double a,b,c;
    cin>>a>>b>>c;
    TDate t(a,b,c);
    t.print();
}
int main(){
    test();
    return 0;
}
全部评论

相关推荐

点赞 评论 收藏
分享
2025-12-18 19:36
已编辑
门头沟学院 Java
程序员牛肉:可以的,简历没毛病了。 虽然还是偏向同质化,不过学历不错。后续我觉得重心放到刷实习+摆脱同质化问题上
实习简历求拷打
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务