-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Extremely_Round.cpp
More file actions
42 lines (39 loc) · 804 Bytes
/
Copy pathA_Extremely_Round.cpp
File metadata and controls
42 lines (39 loc) · 804 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
// ATTEMPTED
#include <iostream>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
long long n;
cin >> n;
int res = 0;
if (n <= 10)
{
res = n;
cout << res << endl;
continue;
}
int x = n;
// int base = 10;
// int limit = 1;
// for (int i = 1; i < 7; i++)
// {
// if (x > base)
// limit++;
// base *= 10;
// }
// int pow_ten = 10;
// for (int i = 1; i < limit+1; i++)
// {
// res += n / pow_ten;
// pow_ten *= 10;
// }
res += x / 10 + x / 100 + x / 1000 + x / 10000;
res += 9;
cout << res << endl;
}
return 0;
}