用c语言编写程序,把12240秒转换成“小时:分钟:秒”
时间: 2024-05-15 11:16:07 浏览: 213
3424,把秒转换成时分秒的c语言源码,c语言程序
```c
#include <stdio.h>
int main()
{
int seconds = 12240;
int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60;
int remainingSeconds = seconds % 60;
printf("%d秒转换成 %d小时:%d分钟:%d秒\n", seconds, hours, minutes, remainingSeconds);
return 0;
}
```
阅读全文