题目描述
题目分析
常考的时间/日期问题。
我的代码
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
ll n;
int main(){
cin>>n;
ll day = 1000 * 60 * 60 * 24;
ll hour = 1000 * 60 * 60;
ll min = 1000 * 60;
ll second = 1000;
ll s = (n % min)/second;
ll m = (n % hour)/min;
ll h = (n % day)/hour;
if(h<10){
cout<<"0";
}
cout<<h<<":";
if(m<10){
cout<<"0";
}
cout<<m<<":";
if(s<10){
cout<<"0";
}
cout<<s;
return 0;
}