#include<stdio.h>
int main()
{
int t,h,m,s,a,b,c;
scanf("%d",&t);//输入多少秒
a=t/3600;//表示多少小时
b=(t%3600)/60;//表示多少分钟
c=(t%3600)%60;//表示多少秒
printf("%02d:%02d:%02d:\n",a,b,c);//按时间的格式输出
return 0;
}
时间转换
最新推荐文章于 2023-04-15 23:43:28 发布
#include<stdio.h>
int main()
{
int t,h,m,s,a,b,c;
scanf("%d",&t);//输入多少秒
a=t/3600;//表示多少小时
b=(t%3600)/60;//表示多少分钟
c=(t%3600)%60;//表示多少秒
printf("%02d:%02d:%02d:\n",a,b,c);//按时间的格式输出
return 0;
}