BASIC-14 VIP试题 时间转换
- 取余
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;
const int N=2e2+9;
const double PI=acos(-1);
#define line '\n'
#define gt getchar()
#define mid ((L+R)>>1)
int read(){int x=0,op=1;char c=gt;while(!isdigit(c)){if(c=='-')op=-1;c=gt;}while(isdigit(c))x=x*10+c-48,c=gt;return x*op;}
int main()
{
int n=read();
cout<<n/3600<<":"<<(n-n/3600*3600)/60<<":"<<n%60<<line;
return 0;
}

浙公网安备 33010602011771号