1144: 电子表
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 62 Solved: 34
[Submit][Status][Web Board]
Description
电子表上的时间显示方法形如xx:xx:xx,现在给出一个时间,单位是秒,要求按照电子表格式输出。
输出保证不会超过24小时。
输出保证不会超过24小时。
Input
Output
3701
Sample Input
01:01:41
AC代码:
#include<cstdio>
int main(){int n, a, b, c;scanf("%d", &n);a = n / 3600;b = (n - a * 3600) / 60;c = n % 60;if(a < 10){if(b < 10){if(c<10){printf("0%d:0%d:0%d", a, b, c);}else{printf("0%d:0%d:%d", a, b, c);}}else{if(c<10){printf("0%d:%d:0%d", a, b, c);}else{printf("0%d:%d:%d", a, b, c);}}}else{if(b < 10){if(c<10){printf("%d:0%d:0%d", a, b, c);}else{printf("%d:0%d:%d", a, b, c);}}else{if(c<10){printf("%d:%d:0%d", a, b, c);}else{printf("%d:%d:%d", a, b, c);}}}//printf("%d:%d:%d", a, b, c);return 0;
}