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;
}
*/
#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;
}
*/
相关文章推荐
- Topcoder SRM 144 Div1 550(数学和dp问题求方案数,很有意思)
- TopCoder SRM 144 DIV1 BinaryCode
- topcoder-srm144-div
- Topcoder SRM 144 DIV 1
- TopCoder 550 points 1-SRM 144 DIV 1 165/550 30%
- Topcoder SRM 144 Div2 1100 (树形dp)
- Topcoder Arena SRM 144 DIV2 1100 point 图遍历(非递归)+动态规划
- TopCoder SRM 144 DIV1 550 Lottery
- TopCoder_SRM_144_DIV2_250_Time
- TopCoder SRM 144 DIV 2
- TopCoder SRM 144 DIV2 550points
- topcoder SRM 144 DIV 1 by First_Blood
- 小朋友学TopCoder(2):第一个TopCoder程序--SRM144 DIV2 200-point
- 【topcoder】 SRM 144 div 2 200
- 小朋友学TopCoder(3):SRM144 DIV2 550-point
- Topcoder SRM144 div2 1100
- 小朋友学TopCoder(4):SRM144 DIV2 1100-point
- TopCoder SRM 144 DIV 1
- 小朋友学TopCoder(5):SRM144 DIV1 550-point
- TopCoder 300 points 1-SRM 144 DIV 1 90/300 30%