水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas
/*
很简单的水题,晚上累了,刷刷水题开心一下:)
*/
#include <bits/stdc++.h>
using namespace std; char s1[][] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
char s2[][] = {"eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};
char s3[][] = {"ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}; int main(void) //Codeforces Round #299 (Div. 2) A. Tavas and Nafas
{
int n;
while (scanf ("%d", &n) == )
{
if (n <= ) printf ("%s\n", s1[n]);
else if ( <= n && n <= ) printf ("%s\n", s2[n-]);
else
{
int x = n / ; int y = n % ;
printf ("%s", s3[x-]);
if (y) printf ("-%s", s1[y]);
puts ("");
}
} return ;
}
水题 Codeforces Round #299 (Div. 2) A. 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) C. Tavas and Karafs
题目传送门 /* 题意:给定一个数列,求最大的r使得[l,r]的数字能在t次全变为0,每一次可以在m的长度内减1 二分搜索:搜索r,求出sum <= t * m的最大的r 详细解释:http:/ ...
- DFS Codeforces Round #299 (Div. 2) B. Tavas and SaDDas
题目传送门 /* DFS:按照长度来DFS,最后排序 */ #include <cstdio> #include <algorithm> #include <cstrin ...
- 水题 Codeforces Round #302 (Div. 2) A Set of Strings
题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> ...
- 水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas
题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm ...
- 水题 Codeforces Round #303 (Div. 2) A. Toy Cars
题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during th ...
- 水题 Codeforces Round #286 (Div. 2) A Mr. Kitayuta's Gift
题目传送门 /* 水题:vector容器实现插入操作,暴力进行判断是否为回文串 */ #include <cstdio> #include <iostream> #includ ...
- 构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root
题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algori ...
- 水题 Codeforces Round #306 (Div. 2) A. Two Substrings
题目传送门 /* 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES */ #include <cstdio> #include <iostream ...
随机推荐
- Android Menu开源项目整合工程
本实例整合了关于Android Menu的优秀开源代码,方便有需要用到Menu开源项目的小伙伴使用. 一.整合的项目有: SlidingMenu:https://github.com/jfeinste ...
- Hdu3785
<span style="color:#6600cc;">/* G - 寻找大富翁 Time Limit:1000MS Memory Limit:32768KB 64b ...
- ln mv 发挥一个物体的元作用
# tar xf ~/tools/mongodb-linux-x86_64-3.4.0.tgz -C /usr/local/; ln -sf /usr/local/mongodb-linux-x86_ ...
- mysql---列的选取原则
列选择原则: :字段类型优先级 整型 > date,整型>浮点型,time > enum,char>varchar > blob 列的特点分析: 整型: 定长,没有国家/ ...
- MYSQL初级学习笔记二:数据表相关操作及MySQL存储引擎!(视频序号:初级_5,7-22|6)
知识点三:数据表相关操作(5,7-22) --------------------------------整型--------------------------------- --测试整型 CREA ...
- hdu 1548 A strange lift 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1548 题目意思:给出 n 个 floor 你,每个floor 有一个数k,按下它可以到达 floor ...
- C语言变量声明问题——变量定义一定要放在所有执行语句/语句块的最前面吗?
报错信息:error C2065: 'salary' : undeclared identifier #include <stdio.h> void main(){ printf(&quo ...
- SPOJ:Help BTW(二分)
BTW wants to buy a gift for her BF and plans to buy an integer array. Generally Integer arrays are c ...
- Watir: 应用Watir-Webdriver 访问需要证书的网站情况
#Suppose we will access an SVN net require 'watir-webdriver' b = Watir::Browser.new :chrome b.goto ' ...
- htm5 vido.js 播放器
js统制html5 [video]标签中视频的播放和停止 需求:页面中有2个普通按钮a,b.还有一个video标签,能成功播放出视频..我想要的效果是,点击a按钮,视频开始播放,点击b按钮,视频播 ...