TopCoder SRM 144 div2

熟悉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)