0
点赞
收藏
分享

微信扫一扫

PAT乙级1026 程序运行时间

Aliven888 2022-05-03 阅读 134
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>

using namespace std;

#define CLK_TCK 100

int main(void){
    int c1, c2;
    cin>>c1>>c2;
    float sub = (float)(c2 - c1);
    float sec = (float)sub/(float)CLK_TCK;

    int hour = sec/3600;
    float remain = sec - hour * 3600;
    int minute = remain/60;
    remain = remain - minute * 60;
    sec = round(remain);
    int second = (int)sec;
    printf("%02d:%02d:%02d\n", hour, minute, second);
    return 0;
}

https://github.com/ZouJiu1/PATicon-default.png?t=M3K6https://github.com/ZouJiu1/PAT

举报

相关推荐

0 条评论