#P2108. 学英语
学英语
Description
To adapt to the intense college study life, Xiao Z decided to review and strengthen his English.
Since Xiao Z is fond of math, he started with numerals. Xiao Z spent a whole day and finally understood everything about cardinal numbers. He was very excited and decided to make some problems to quiz Xiao G, who has passed the College English Test Band 4 (CET-4) and is known as an “English master.” The rule is simple: Xiao Z gives the English spelling of an integer , and Xiao D is required to write in Arabic numerals.
Xiao Z guarantees the following:
- .
- Only the following English words will be used in the problem statement:
negative, zero, one, two, three, four, five, six, seven, eight, nine, teneleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twentythirty, forty, fifty, sixty, seventy, eighty, ninety, hundred, thousand, million - If is negative, the first word in the problem statement is
negative; otherwise, the wordnegativewill never appear. - Because Xiao Z is very confident, he does not know that numbers like should be written as
one hundred and threeand instead writesone hundred three. That is, the wordandnever appears in any of Xiao Z’s problems (even though it normally should). Please understand. - Except for point 4, the rest basically follow English grammar; for example, is written as
one thousand five hundredrather thanfifteen hundred.
Upon receiving the problem, Xiao D scoffed: “Trivial! Just write a program...”.
But Xiao D is going out to have fun (by now probably thousands of miles away), so this task is left to you.
Input Format
One line, the English representation of as described in the problem statement.
Output Format
One line, the Arabic numeral form of .
six
6
negative seven hundred twenty nine
-729
one million one hundred one
1000101
eight hundred fourteen thousand twenty two
814022
Hint
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号