Back
Close

Number in words.

Statement

 Goal

Output number but in words. number is either a 1-digit number or 2-digit number.

The 1-digit numbers are 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', and 'nine'.
The two digit numbers starting with 1 are 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', and 'nineteen'.
Numbers bigger than 20 need a hyphen('-') between their tens and ones digit.
Other than 0 and 10, the multiples of 10 are 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', and 'ninety'.

Example:
If number is 52, output fifty-two
Input
Line 1: An integer number for the number you need to output.
Output
number in words
Constraints
1 ≤ number ≤ 99
Example
Input
52
Output
fifty-two

Game modes
FastestShortest

Test cases
Example Test
Input
52
Output
fifty-two

Validator 1 Validator
Input
34
Output
thirty-four

1-digit Test
Input
4
Output
four

Validator 2 Validator
Input
7
Output
seven

11 = eleven and 12 = twelve Test
Input
11
Output
eleven

Validator 3 Validator
Input
12
Output
twelve

repeat Test
Input
99
Output
ninety-nine

Validator 4 Validator
Input
77
Output
seventy-seven

starts with 1 Test
Input
15
Output
fifteen

Validator 5 Validator
Input
19
Output
nineteen

ends with 0 Test
Input
70
Output
seventy

Validator 6 Validator
Input
60
Output
sixty

Solution language

Solution

Stub generator input
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants