PAT乙级1026程序运行时间(秒数转换为时间)(值得学习)


https://pintia.cn/problem-sets/994805260223102976/problems/994805295203598336


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b;
    cin>>a>>b;
    int c=round((b-a)/100);
    int h=c/3600;
    int m=c%3600/60;
    int s=c%60;
    printf("%02d:%02d:%02d",h,m,s);
    return 0;
}
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页