1026 程序运行时间

水题。

#include<iostream>
#include<cmath>
using namespace std;

int main() {
    int c1,c2;
    cin>>c1>>c2;
    int t = round((c2-c1)/100.0);//不足 1 秒的时间四舍五入到秒
    int h = t/3600;//
    int m = t%3600/60;//
    int s = t%60;//
    printf("%02d:%02d:%02d",h,m,s);
    return 0;
}

 

posted @ 2020-02-18 11:57  tangq123  阅读(96)  评论(0编辑  收藏  举报