오븐 시계
2023. 1. 26. 17:13ㆍ개인공부/코딩테스트
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
|
#include <iostream>
using namespace std;
int main()
{
int Minute;
int Second;
int CookingTime;
cin >> Minute >> Second >> CookingTime;
Second += CookingTime;
while (Second >= 60)
{
Second -= 60;
++Minute;
}
if (Minute > 23)
{
Minute = Minute % 24;
}
cout << Minute << " " << Second;
return 0;
}
|
cs |