解题思路:
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:591 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:1206 |
K-进制数 (C++代码)浏览:858 |
程序员的表白 (C语言代码)浏览:1472 |
C语言程序设计教程(第三版)课后习题6.7 (C语言代码)浏览:646 |
简单编码 (C++代码)浏览:678 |
蓝桥杯历届试题-九宫重排 (C++代码)浏览:2783 |
简单的a+b (C语言代码)浏览:676 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)for循环浏览:1131 |
P1002 (C语言代码)浏览:980 |