AcWing 3416. 时间显示
原题链接
简单
作者:
张智豪
,
2021-04-28 11:56:17
,
所有人可见
,
阅读 334
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
int main()
{
LL nm;
LL ss, mm, hh;
scanf("%lld", &nm);
LL sum = nm / 1000;
//print("%l64d", sum);
ss = sum % 60;
sum = sum / 60;
mm = sum % 60;
sum = sum / 60;
hh = sum % 24;
if (hh < 10) printf("0%lld", hh);
else printf("%d", hh);
if (mm < 10) printf(":0%lld", mm);
else printf(":%d", mm);
if (ss < 10) printf(":0%lld", ss);
else printf(":%d", ss);
return 0;
}