-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4539.cpp
More file actions
47 lines (45 loc) · 852 Bytes
/
4539.cpp
File metadata and controls
47 lines (45 loc) · 852 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 4539. 반올림
// 2021.11.10
// 수학
#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
int n;
cin >> n;
if (n > 10)
{
n = (n + 5) / 10 * 10;
}
if (n > 100)
{
n = (n + 50) / 100 * 100;
}
if (n > 1000)
{
n = (n + 500) / 1000 * 1000;
}
if (n > 10000)
{
n = (n + 5000) / 10000 * 10000;
}
if (n > 100000)
{
n = (n + 50000) / 100000 * 100000;
}
if (n > 1000000)
{
n = (n + 500000) / 1000000 * 1000000;
}
if (n > 10000000)
{
n = (n + 5000000) / 10000000 * 10000000;
}
cout << n << endl;
}
return 0;
}