输入秒数,将它按小时、分钟、秒的形式来输出.例如输入24680 秒,则输出6小时51分20秒. 是C方向的 相关知识点: 试题来源: 解析 Private Sub Form_Load() Dim H As Long, M As Long, S As Long Dim SC As Long SC = 24680 H = SC \ 3600 M = (SC - H * 3600) \ 60 S = SC - H * ...
解答一 举报 Private Sub Form_Load() Dim H As Long, M As Long, S As Long Dim SC As Long SC = 24680 H = SC \ 3600 M = (SC - H * 3600) \ 60 S = SC - H * 3600 - M * 60 MsgBox H & "小时" & M & "分... 解析看不懂?免费查看同类题视频解析查看解答 ...
得到如下代码:include <stdio.h>int main(){int s, h, m;scanf("%d", &s);h = s / 3600;s %= 3600;m = s / 60;s %= 60;printf("%d小时%d分钟%d秒\n", h, m, s);return 0;}