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

9956번 - Reversing Words 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB62444070.175%

문제

“Oh no, not another reversing problem! We did those in Programming 101, years ago”, I hear you cry. Well yes, but this problem is just a little different, in that you have to reverse individual words, not entire sentences. Furthermore, only the letters are to be reversed — spaces, punctuation and case are unaffected.

For this problem a word is defined to be a sequence of characters containing at least two letters and delimited by whitespace. The letters in the word must be written in reverse order (so 'the' becomes 'eht'), but the other characters in the word remain in their original sequence. Furthermore, if a character in the original word is upper-case, the letter in the same position in the new word must also be uppercase, thus 'Smith-Jones' becomes 'Senoj-Htims'. The position of the word in the line must be unaltered, and the position of every non-letter must also be unaltered (so double blanks remain as double blanks).

입력

Input will be a series of lines, terminated by a line consisting of a single '#'. No line will have more than 80 characters.

출력

Output will consist of a series of lines, one for each line in the input, with the letters in each word reversed as described above.

제한

예제 입력 1

This iS ;ate:'st "";; aBc.
Smith-Jones
#

예제 출력 1

Siht sI ;tse:'ta "";; cBa.
Senoj-Htims

힌트

출처

ICPC > Regionals > South Pacific > South Pacific Region > New Zealand Programming Contest > NZPC 2007 J번

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

출처

대학교 대회

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

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