Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 3 / Tasks and Solutions / 13. ClockWithStartAndEnd.cpp
blob: af39745927aa345220efed5e4eef95a138a64a66 (plain) (blame)
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
37
38
39
40
41
#include <iostream>
using namespace std;

int main()
{
	int hStart, mStart, hEnd, mEnd;
	cin >> hStart >> mStart >> hEnd >> mEnd;

	for (int min = mStart + 1; min <= 59; min++)
	{
		if (hStart < 10)
			cout << 0;
		cout << hStart << ":";
		if (min < 10)
			cout << 0;
		cout << min << endl;
	}

	for (int hour = hStart+1; hour <= hEnd-1; hour++)
	{
		for (int min = 0; min <= 59; min++)
		{
			if (hour < 10)
				cout << 0;
			cout << hour << ":";
			if (min < 10)
				cout << 0;
			cout << min << endl;
		}
	}

	for (int min = 0; min < mEnd; min++)
	{
		if (hEnd < 10)
			cout << 0;
		cout << hEnd << ":";
		if (min < 10)
			cout << 0;
		cout << min << endl;
	}
}