题解 | #时间转换#
时间转换
https://www.nowcoder.com/practice/c4ae7bcac7f9491b8be82ee516a94899
#include <stdio.h> int main() { int a; scanf("%d",&a); int t=a%60;//对a取余即是秒 if(a/60>60)//1h=60min 要精确到h,min,60是分界点; { { a=a/60; } printf("%d %d ",a/60,a%60); } else { printf("%d %d ",a/3600,a/60); } printf("%d",t); return 0; }