蓝桥杯 基础练习 时间转换(vip)

版权声明:(整理不易,如本文对您有益,请为我点赞吧!)本文为博主原创文章,转载请附上博文链接! https://blog.csdn.net/Qi2456/article/details/88285491

 基础练习 时间转换

代码

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int s=n%60;
    int h=n/3600;
    int m=n/60%60;
    cout<<h<<":"<<m<<":"<<s;
    return 0;
}

猜你喜欢

转载自blog.csdn.net/Qi2456/article/details/88285491