1221: 秒数转换为时分秒

#include <stdio.h>
int main()
{
int hour,minute,second;
long long n;
while( scanf("%lld",&n)!=EOF)
{
hour=0,minute=0,second=0;
hour=n/3600;
n%=3600;
minute=n/60;
n%=60;
second=n;
if(hour>24) hour%=24;
printf("%02d:%02d:%02d\n",hour,minute,second);
}

}

posted @ 2020-02-01 15:56  我是个好孩子  阅读(565)  评论(0编辑  收藏  举报