如何用C语言写一个程序将一万秒转化为两小时46分40秒
时间: 2023-05-28 16:03:10 浏览: 74
C语言实现秒与时间的互相转换
```
#include <stdio.h>
int main() {
int seconds = 10000;
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
printf("10000 seconds is equal to %d hours %d minutes %d seconds\n",
hours, minutes, seconds);
return 0;
}
```
输出结果为:
```
10000 seconds is equal to 2 hours 46 minutes 40 seconds
```
阅读全文