-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04_02.cpp
More file actions
32 lines (28 loc) ยท 718 Bytes
/
04_02.cpp
File metadata and controls
32 lines (28 loc) ยท 718 Bytes
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
/***********************
* date : 2022-04-06
* topic : ๊ตฌํ
* feedback :
* 1. ์๊ฐ ๋ณ์๋ช
: ์ h, ๋ถ m, ์ด s
* 2. ํ์ํ ๋ฐ์ดํฐ๊ฐ 100๋ง๊ฐ ์ดํ์ผ๋๋ง 2์ด์ด๋ด ํ ์ ์์
* 3. ์๊ฐ์ ์ ์ฒด ๋ค ํ์ํด๋ 86,400๊ฐ (60 * 60 * 24)
* time : 15 min
************************/
#include<iostream>
using namespace std;
int main_04_02()
{
// ์๊ฐ ์
๋ ฅ ๋ฐ๊ธฐ
int hour;
cin >> hour;
// 3์ด ๋ค์ด๊ฐ ์๊ฐ ๊ตฌํ๊ธฐ
int time_cnt = 0;
for(int x=0;x<=hour;x++){
for(int y=0;y<60;y++){
for(int z=0;z<60;z++){
if(x%10 == 3 || y%10 == 3 || y/10 == 3 || z%10 == 3 || z/10 == 3) time_cnt++;
}
}
}
cout << time_cnt;
return 0;
}