CF Tavas and Nafas
1 second
256 megabytes
standard input
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.
The first and only line of input contains an integer s (0 ≤ s ≤ 99), Tavas's score.
In the first and only line of output, print a single string consisting only from English lowercase letters and hyphens ('-'). Do not use spaces.
6
six
99
ninety-nine
20
twenty 英语基础题
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cctype>
#include <queue>
#include <map>
using namespace std; char HIGH[][] = {"ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"};
char TEN[][] = {"ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen",
"seventeen","eighteen","nineteen"};
char LOW[][] = {"zero","one","two","three","four","five","six","seven","eight",
"nine"};
int main(void)
{
string s;
int len; while(cin >> s)
{
len = s.size();
if(len == )
cout << LOW[s[] - ''] << endl;
else if(s[] == '')
cout << TEN[s[] - ''] << endl;
else
{
if(s[] == '')
cout << HIGH[s[] - ''] << endl;
else
cout << HIGH[s[] - ''] << '-' << LOW[s[] - ''] << endl;
}
} return ;
}
CF Tavas and Nafas的更多相关文章
- Codeforces Round #299 (Div. 2) A. Tavas and Nafas 水题
A. Tavas and Nafas Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/535/pr ...
- 水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas
题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {" ...
- CF Tavas and Karafs (二分)
Tavas and Karafs time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...
- 【Codeforces Round #299 (Div. 2) A】 Tavas and Nafas
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟题 [代码] #include <bits/stdc++.h> using namespace std; map & ...
- CF535A Tavas and Nafas 题解
Content 请输出整数 \(s\) 的英文写法. 数据范围:\(0\leqslant s\leqslant 99\). Solution 直接对应打表即可. 当 \(0\leqslant s\le ...
- Codeforces Round #299 Div2 解题报告
这场比赛并没有打现场,昨天晚上做了ABCD四道题,今天做掉了E题 以前还没有过切完一场比赛的所有题呢~爽~ A. Tavas and Nafas Today Tavas got his test ...
- Codeforces Round #299 (Div. 2)A B C 水 dfs 二分
A. Tavas and Nafas time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- CF 535c Tavas and Karafs
Tavas and Karafs Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u S ...
- CF #299 div1 B. Tavas and Malekas KMP-next数组
题目链接:http://codeforces.com/contest/536/problem/B 一个原始字符串,一个未知字符串,每一次从pos[i]开始覆盖未知字符串,问最后字符串的形式,以及判断过 ...
随机推荐
- 在Delphi7中JSON遍历节点不支持使用IN处理方法
相关资料:http://www.cnblogs.com/del/archive/2009/10/23/1588690.html Delphi2007源代码: procedure TForm1.Butt ...
- Web安全--使用Salt + Hash将密码加密后再存储进数据库
转载原地址 http://www.bozhiyue.com/mianshiti/_net/2016/0728/314239.html (一) 为什么要用哈希函数来加密密码 如果你需要保存密码(比如网站 ...
- POJ 3468 A Simple Problem with Integers (线段树成段更新)
题目链接:http://poj.org/problem?id=3468 题意就是给你一组数据,成段累加,成段查询. 很久之前做的,复习了一下成段更新,就是在单点更新基础上多了一个懒惰标记变量.upda ...
- POJ 3694 Network (tarjan + LCA)
题目链接:http://poj.org/problem?id=3694 题意是给你一个无向图n个点,m条边,将m条边连接起来之后形成一个图,有Q个询问,问将u和v连接起来后图中还有多少个桥. 首先用t ...
- CentOS服务器配置发送邮件服务
CentOS服务器配置发送邮件服务 lsb_release -a 查看linux系统版本 在CentOS6以上版本自带mailx版本12.4 rpm -qa | grep mailx 查看系统自带的m ...
- [IoC容器Unity] :Unity预览
1.引言 高内聚,低耦合成为一个OO架构设计的一个参考标准.高内聚是一个模块或者一个类中成员跟这个模块或者类的关系尽量高,低耦合是不同模块或者不同类之间关系尽量简单. 拿咱国家举例来说,假如你是中国人 ...
- PostgreSQL的 initdb 源代码分析之八
继续分析 由于 我并未进行特殊的参数设置,所以 (strlen(default_text_search_config) == 0) 成立. 故 调用 default_text_search_con ...
- web.xml里<filter-mapping>中的<dispatcher>作用
2.4版本的servlet规范在部属描述符中新增加了一个<dispatcher>元素,这个元素有四个可能的值:即REQUEST,FORWARD,INCLUDE和ERROR,可以在一个< ...
- Crouton
https://github.com/keyboardsurfer/Crouton https://github.com/GBouerat/Crouton https://github.com/ouy ...
- Chronometer控件实现的Android计时器
本文为大家演示了如何使用Chronometer控件实现Android计时器的实例. 先贴上最终的实现效果图: Android计时器实现思路 使用Chronometer控件实现计器的操作.通过设置set ...