cf 535 A. Tavas and Nafas
2015-04-15 04:23
288 查看
A. Tavas and Nafas
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Today Tavas got his test result as an integer score and he wants to share it with his girlfriend, Nafas.
His phone operating system is Tavdroid, and its keyboard doesn't have any digits! He wants to share his score with Nafas via text, so he has no choice but to send this number using words.
He ate coffee mix without water again, so right now he's really messed up and can't think.
Your task is to help him by telling him what to type.
Input
The first and only line of input contains an integer s (0 ≤ s ≤ 99), Tavas's score.
Output
In the first and only line of output, print a single string consisting only from English lowercase letters and hyphens ('-'). Do not use spaces.
Sample test(s)
input
output
input
output
input
output
Note
You can find all you need to know about English numerals in http://en.wikipedia.org/wiki/English_numerals .
在考英语2333
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Today Tavas got his test result as an integer score and he wants to share it with his girlfriend, Nafas.
His phone operating system is Tavdroid, and its keyboard doesn't have any digits! He wants to share his score with Nafas via text, so he has no choice but to send this number using words.
He ate coffee mix without water again, so right now he's really messed up and can't think.
Your task is to help him by telling him what to type.
Input
The first and only line of input contains an integer s (0 ≤ s ≤ 99), Tavas's score.
Output
In the first and only line of output, print a single string consisting only from English lowercase letters and hyphens ('-'). Do not use spaces.
Sample test(s)
input
6
output
six
input
99
output
ninety-nine
input
20
output
twenty
Note
You can find all you need to know about English numerals in http://en.wikipedia.org/wiki/English_numerals .
在考英语2333
#include <iostream> using namespace std; int main() { int s,a,b; cin>>s; switch(s) { case 0:cout<<"zero";return 0; case 10:cout<<"ten";return 0; case 11:cout<<"eleven";return 0; case 12:cout<<"twelve";return 0; case 13:cout<<"thirteen";return 0; case 14:cout<<"fourteen";return 0; case 15:cout<<"fifteen";return 0; case 16:cout<<"sixteen";return 0; case 17:cout<<"seventeen";return 0; case 18:cout<<"eighteen";return 0; case 19:cout<<"nineteen";return 0; } a = s /10; b = s%10; switch(a) { case 0:break; case 2:cout<<"twenty";break; case 3:cout<<"thirty";break; case 4:cout<<"forty";break; case 5:cout<<"fifty";break; case 6:cout<<"sixty";break; case 7:cout<<"seventy";break; case 8:cout<<"eighty";break; case 9:cout<<"ninety";break; } if (b!=0) { if (a!=0) cout<<"-"; switch(b) { case 1:cout<<"one";break; case 2:cout<<"two";break; case 3:cout<<"three";break; case 4:cout<<"four";break; case 5:cout<<"five";break; case 6:cout<<"six";break; case 7:cout<<"seven";break; case 8:cout<<"eight";break; case 9:cout<<"nine";break; } } return 0; }
相关文章推荐
- [CF]Sums of Digits
- cf 276b 博弈
- [CF Round #294 div2] D. A and B and Interesting Substrings 【Map】
- [推荐算法]UserCF,基于用户的协同过滤算法
- cf_296(Div2)
- cf- 297 < b > -- 区间翻转操作的优化
- [CF 332D]Theft of Blueprints题解中数学结论证明的翻译
- CF Theatre Square
- [CF 316G3]Good Substrings解题报告
- CF 500G
- CF Fox And Two Dots (DFS)
- cf 301 div2
- cf-114A
- cf 546C Soldier and Cards
- CF 548A
- CF 303C——Minimum Modular——————【剪枝】
- 素数打表 cf 546D
- CF 1B Spreadsheet
- CF 9B Running Student
- CF 11B Jumping Jack