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]开始覆盖未知字符串,问最后字符串的形式,以及判断过 ...
随机推荐
- vim MiniBufExplorer 插件
MiniBufExplorer安装好久了,但一直没怎么使用过. 今天查了下资料,作为一个备份. 当你只编辑一个buffer的时候MiniBufExplorer派不上用场, 当 你打开第二个buffer ...
- Android问题-新电脑新系统WIN764位上安装简版本的XE8提示“Unit not found: 'System'”
问题现象:电脑太慢,重安新系统,所以要安DELPHIXE8,但安装过程中出现二次杀软件提示,我都选的是通过.但是XE8过程到最后的"Create AVD"时出现一个错误(具体是什么 ...
- 问题-Delphi2007跟踪变量时提示“E2171 Variable 'APolygon' inaccessible here due to optimization”
问题现象:Delphi2007跟踪变量时提示“E2171 Variable 'APolygon' inaccessible here due to optimization” . 问题原因:可能是因为 ...
- [iOS微博项目 - 1.5] - NavigationBar标题按钮
A.NavigationBar标题按钮 1.需求 在“首页”的导航栏中部设置一个“首页”文字+箭头按钮 统一设置样式 根据实际文本长度调整宽度 消除系统自带的点击高亮效果 点击按钮,箭头上下颠倒 gi ...
- Chrome的Postman的使用
Chrome提供了一个很好的Web App 名为 Postman 使用这个web app,你可以输入一个url,然后可以很清楚的看到返回的各种结果 直接在Google中输入Postman, 找到它 ...
- DllImport属性详解
API函数是构筑Windows的基石, 是Windows编程的必备利器.每一种Windows应用程序开发工具都提供间接或者直接的方式调用Win32API,C#也不例外.使用Win32API的一个好处就 ...
- Java学习笔记(四):流程控制
if语句 if判断语句比较简单,具体有下面的几种写法: int i = 0; // if 判断 if (i == 0) { // to do something } // if else 判断 if ...
- HttpModule的认识与深入理解及MVC运行机制
转自:http://kb.cnblogs.com/page/50130/ ASP.NET MVC架构与实战系列之二:理解MVC路由配置 http://www.cnblogs.com/jyan/arch ...
- node-webkit
最近迷上了node-webkit工程.准备搜集并整理一些东西放在这里
- UVa 11111 Generalized Matrioshkas
嵌套玩具, 要求外层玩具的尺寸比内层玩具尺寸的和要大. 每一个玩具由一个负数与相应的正数表示, 在这两数之间的部分即为此玩具内部的玩具. 要求判断一串输出的数字是否能组成一个合法的玩具. 一个合法的玩 ...