题目:输入一个数,按照时:分:秒输出。
例如:
输入:5436
输出:1:30:36
#include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
int h=t/3600;
int m=(t-3600*h)/60;
int s=t-3600*h-60*m;
cout<<h<<":"<<m<<":"<<s<<endl;
return 0;
}
题目:输入一个数,按照时:分:秒输出。
例如:
输入:5436
输出:1:30:36
#include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
int h=t/3600;
int m=(t-3600*h)/60;
int s=t-3600*h-60*m;
cout<<h<<":"<<m<<":"<<s<<endl;
return 0;
}