본문 바로가기
알고리즘

[BAEKJOON] 13297 Quick Estimates

by mAlfred 2025. 6. 18.
반응형

문제

Let’s face it... you are not that handy. When you need to make a major home repair, you often need to hire someone to help. When they come for the first visit, they make an estimate of the cost. Here they must be careful: if they overestimate the cost, it might scare you off, but if they underestimate, the work might not be worth their time.

Because the worker is so careful, it can take a long time for them to produce the estimate. But that’s frustrating — when you ask for an estimate, you really are asking for the magnitude of the cost. Will this be $10 or $100 or $1 000? That’s all you really want to know on a first visit.

Please help the worker make the type of estimate you desire. Write a program that, given the worker’s estimate, reports just the magnitude of the cost — the number of digits needed to represent the estimate.

입력

Input begins with a line containing an integer N (1 ≤ N ≤ 100). The next N lines each contain one estimated cost, which is an integer between 0 and 10100. (Some of the workmen overcharge quite a bit.)

출력

For each estimated cost, output the number of digits required to represent it.

예제 입력 1 복사

5
314
1
5926
5
35897

예제 출력 1 복사

3
1
4
1
5

예제 입력 2 복사

3
0
10
100

예제 출력 2 복사

1
2
3

입력 CASE에 대해 입려된 값의 자리수를 출력하면 되는 문제

 

처음에는 문제를 읽을 때 계산을 해야되는 줄 알았는데 아니였음 

 

n = int(input())
for _ in range(n):
    print(len(input()))

 

반응형

'알고리즘' 카테고리의 다른 글

[BAEKJOON] 25932 Find the Twins  (0) 2025.06.26
[BAEKJOON] 2863 이게 분수?  (0) 2025.06.19
[BAEKJOON] 15700 타일 채우기 4  (0) 2025.06.18
[BAEKJOON] 4287 Word Ratios  (0) 2025.06.05
[BAEKJOON] 33950 어게인 포닉스  (0) 2025.06.05