解题思路:
注意事项:
参考代码:
#include<iostream> #include<iomanip> #include<cmath> using namespace std; class Time { public: void Set(int time) { this->h=time/3600; this->m=time%3600/60; this->s=time%60; } void Display() { cout<<h<<":"<<m<<":"<<s<<endl; } private: int h,m,s; }; int main() { class Time t; long int t1; cin>>t1; t.Set(t1); t.Display(); return 0; }
0.0分
0 人评分
程序员的表白 (C语言代码)浏览:1462 |
简单的a+b (C语言代码)浏览:547 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:424 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:451 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:1419 |
校门外的树 (C语言代码)浏览:692 |
IP判断 (C语言描述,蓝桥杯)浏览:1095 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:664 |
循环入门练习5 (C语言代码)浏览:831 |
格式化数据输出 (C语言代码)浏览:813 |