Logo
(追記) (追記ここまで)

26516번 - Mutint 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB1811109859.394%

문제

A “Mutint” is an integer M that is changed according to certain criteria, such as in this problem. Given a positive integer, change M according to the following rules.

  1. Find the leftmost largest digit D of M.
  2. If D is odd, change it to a zero.
  3. If D is even, add 4 to that digit. If the sum exceeds 9, change D to the one’s place of the sum.

입력

Several integers, each on one line. The end of input is signaled with a zero on the last line. All integers, except the last integer, are positive.

출력

M, according to the rules above. M cannot have leading zeros.

제한

예제 입력 1

132
1421
18234
923
0

예제 출력 1

102
1821
12234
23

힌트

출처

School > PLU High School Programming Contest > PLU 2016 > Advanced 8번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /