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

9216번 - The Queen's English 다국어

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

문제

In the official British written word format for numbers, tens and units are separated by a hyphen, and hundreds are separated from tens or units by the word "and". For example the number 123 would be written "one hundred and twenty-three". Large numbers are written in "triads" (groups of three digits) followed by the appropriate suffixes. For example 123456 is "one hundred and twenty-three thousand four hundred and fifty-six". As a special case, if the final triad of a large number has a tens or units component but no hundreds component, it needs an "and". Thus 1001001 is "one million one thousand and one".

Your task is to write a program that produces correct British written format for numbers of up to 9 digits (less than one "short" billion). Note that the correct spellings are "fifteen" and "fifty" ('f' instead of 'v'), and "forty" (no 'u').

입력

Input will consist of specifications for a series of tests. Information for each test is a single line containing an integer 1 <= n < 1000000000 that specifies the value to process. A line containing the value 0 terminates the input.

출력

Output should consist of one line for each test comprising the test number (formatted as shown) followed by a single space and the correct British word form of the input value, with a single space between words.

제한

예제 입력 1

123
1001001
900090009
0

예제 출력 1

Test 1: one hundred and twenty-three
Test 2: one million one thousand and one
Test 3: nine hundred million ninety thousand and nine

힌트

출처

ICPC > Regionals > South Pacific > South Pacific Region > Australian Programming Contest > AuPC 2013 D번

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

출처

대학교 대회

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

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