문제
Someone is waiting at a secret location and has sent a text message with the coordinates of their location. The message contains the latitude and longitude coordinates in degrees, minutes, and seconds. Of course, the message is encoded so you must write a program to decode the message. The message is 6 lines and the number of characters in each line corresponds to the coordinates of the secret location.
입력
There are six lines of input.
출력
There should be two lines of output. The first line will start with the word Latitude followed by three positive integers and the integers will be separated by colons. The second line will start with the word Longitude followed by three positive integers and the integers will be separated by colons. The output should have the following format.
Latitude x1:x2:x3
Longitude x4:x5:x6
There should be one space between the first word on each line and the first positive integer on the line. The variable xi (1≤ i ≤ 6) is the number of characters in the ith line of input.
풀이
6개의 줄을 입력받고, 각 줄의 길이를 구해야 한다.(줄의 맨 끝 공백은 무시해야한다.)
구한 길이를 위도와 경도로 출력하면 된다.
소스코드
출처
'PS > Baekjoon Online Judge' 카테고리의 다른 글
[백준 20737] Sanic [Python] (0) | 2024.06.21 |
---|---|
[백준 14467] 소가 길을 건너간 이유 1 [Python] (1) | 2024.06.19 |
[백준 01790] 수 이어 쓰기 2 [Java] (0) | 2024.04.10 |
[백준 01019] 책 페이지 [Java] (0) | 2024.04.09 |
[백준 01456] 거의 소수 [Java] (1) | 2024.04.06 |