解题思路:1小时等于3600秒,1分钟等于60秒,h(小时)=t/3600,m(分钟)=t%3600/60;s(秒)=t%60;
注意事项:
参考代码:
#include<stdio.h>
int main()
{
int t;
int h,m,s;
scanf("%d",&t);
h=t/3600;
m=t%3600/60;
s=t%60;
printf("%d:%d:%d",h,m,s);
return 0;
}
0.0分
10 人评分