您的位置:首页 > 运维架构

TopCoder SRM 144 div2

2014-05-13 16:52 405 查看
熟悉TC的第一道题。。



#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std;

class Time
{
public:
string whatTime(int s);
};

string Time::whatTime(int s)
{
int hh, mm, ss;
char buf[20];
hh = s / 3600;
s %= 3600;
mm = s / 60;
s %= 60;
ss = s;
sprintf(buf, "%d:%d:%d\n", hh, mm, ss);
string ans = buf;
return ans;
}

/*
int main()
{
Time time;
int s;
cin >> s;
cout << time.whatTime(s) << endl;
return 0;
}
*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ACM TopCoder