In this problem, you will be given one or more integers in English. Your task is to translate these numbers into their integer representation. The numbers can range from negative 999,999,999 to positive 999,999,999. The following is an exhaustive list of English words that your program must account for:
negative, zero, one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety, hundred, thousand, million
Notes on input:
hundredis not used when
thousandcould be. For example, 1500 is written
one thousand five hundred, not
The answers are expected to be on separate lines with a newline after each.
six negative seven hundred twenty nine one million one hundred one
6 -729 1000101
This challenge is provided by the ACM International Collegiate Programming Contest.
Please log in to submit your solution.
|Average test runtime||0.29|
|Points (changes over time)||10|
|Tried by||14 users|
|Solved by||12 users|