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

34370번 - Fixing Figures 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB2111844.444%

문제

You have just been hired to the Fixing Good lawyer team as an editor. Your boss, Saul Badman, is an incredible lawyer, but has one small quirk: he always forgets to spell out numbers as words in his reports.

It is customary in formal documents to write out numbers, and unfortunately for Saul, he is dealing with lawsuits which involve lots of numbers. Saul forgets to write out numbers so often that you decide it would be easier to write a program that does the job.

Your task is to translate a given number into the corresponding English word(s). For instance, 5280ドル$ becomes "five thousand two hundred eighty".

If a number is in the ones place after a number in the tens place, it should have a dash between the words representing the tens and ones places, such as 45ドル$ becoming "forty-five". This rule applies to thousands as well, such as "forty-five thousand".

You should not include "and" nor "," in your answer.

For a full word to number reference, view the following tables:

Ones
0ドル$ zero
1ドル$ one
2ドル$ two
3ドル$ three
4ドル$ four
5ドル$ five
6ドル$ six
7ドル$ seven
8ドル$ eight
9ドル$ nine
Teens
11ドル$ eleven
12ドル$ twelve
13ドル$ thirteen
14ドル$ fourteen
15ドル$ fifteen
16ドル$ sixteen
17ドル$ seventeen
18ドル$ eighteen
19ドル$ nineteen
Tens
10ドル$ ten
20ドル$ twenty
30ドル$ thirty
40ドル$ forty
50ドル$ fifty
60ドル$ sixty
70ドル$ seventy
80ドル$ eighty
90ドル$ ninety

Powers of Ten

10ドル^2$ hundred
10ドル^3$ thousand
10ドル^6$ million

Also note that if a number is negative, the word "negative" should be prepended to the front of the resulting written number.

입력

The first line of input will be an integer 1ドル \leq N \leq 1,000円,ドル the number of numbers you are to convert to English word(s) The next $N$ lines will each contain an integer $X_i$ in the range $[-9,999円,999,円 9,999円,999円],ドル the $i^\text{th}$ number you are to convert. Numbers are guaranteed to be integers.

출력

The program should output $N$ lines, with the $i^\text{th}$ line containing the English word(s) for the number $X_i$ from the input.

제한

예제 입력 1

4
0
5
10
18

예제 출력 1

zero
five
ten
eighteen

예제 입력 2

4
-93564
234
-1
1234567

예제 출력 2

negative ninety-three thousand five hundred sixty-four
two hundred thirty-four
negative one
one million two hundred thirty-four thousand five hundred sixty-seven

예제 입력 3

4
400
401
410
411

예제 출력 3

four hundred
four hundred one
four hundred ten
four hundred eleven

예제 입력 4

4
50
1111
80
100

예제 출력 4

fifty
one thousand one hundred eleven
eighty
one hundred

노트

출처

School > CS@Mines > CS@Mines HSPC 2023 > Beginner I번

  • 문제를 만든 사람: Ethan Richards
(追記) (追記ここまで)

출처

대학교 대회

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

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