题解 | #时间转换#
时间转换
https://www.nowcoder.com/practice/c4ae7bcac7f9491b8be82ee516a94899
#include <stdio.h>
int main()
{
int s = 0;
int h = 0;
int m = 0;
scanf("%d", &s);
if (s < 60)
printf("%d %d %d",0,0, s);
else if (s >= 60 && s < 3600)
{
printf("%d ",0);
m = s / 60;
printf("%d ", m);
s = s%60;
printf("%d ",s);
}
else
{
h = s / 3600;
printf("%d ", h);
m = s % 3600 / 60;
printf("%d ", m);
s = s % 3600 % 60;
printf("%d ", s);
}
return 0;
}



