AcWing 654. 時間轉換

nighty_k 2022-01-07 20:44:43 阅读数:389

acwing

鏈接
https://www.acwing.com/problem/content/656

思路
同上一題AcWing 653. 鈔票

#include <cstdio>
int main()
{

int n;
scanf("%d", &n);
int a[3] ={
60*60, 60, 1};
for (int i = 0; i < 3; i ++)
{

printf("%d",n / a[i]);
if(i !=2) printf(":");
n = n % a[i];
}
return 0;
}
版权声明:本文为[nighty_k]所创,转载请带上原文链接,感谢。 https://gsmany.com/2022/01/202201072044426691.html