Blame view

P34279_en/S001-AC.cc 381 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
	int h,m,s;

	cin >> h;
	cin >> m;
	cin >> s;

	s++;

	if(s == 60)
	{
		s = 0;
		m++;
	}
	if(m == 60)
	{
		m = 0;
		h++;
	}
	if(h == 24)
	{
		h = 0;
	}

	cout << setw(2) << setfill('0') << h << ":";
	cout << setw(2) << setfill('0') << m << ":";
	cout << setw(2) << setfill('0') << s << endl;

	return 0;
}