啊哈磊_编程从这里起步

标题: 输入秒数,给出时:分:秒 的 [打印本页]

作者: 非非    时间: 2018-12-21 15:31
标题: 输入秒数,给出时:分:秒 的


作者: 古都人    时间: 2019-1-4 18:26
#include <stdio.h>
#include <stdlib.h>
int main()
{
        int b,s=0,min=0,h=0;
    scanf("%d",&b);
    s=b%60;
    min=((b-s)/60)%60;
    h=b-s-min*60;
    h=h/3600%60;
    printf("%d时%d分%d秒",h,min,s);
        system("pause");
        return 0;
}






欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2