水题 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 ...
随机推荐
- 有遍历struct中字段信息的函数或方法
例:struct a{int a;char b[10];double c;}; 在程序中只知道一个结构 a 的指针, 有没有函数能通过结构的名字 和 指向结构的指针 随次得到 结构中的变量类型 和 变 ...
- object-c iOS 教程 git for mac
本文转载至 http://blog.csdn.net/u011728347/article/details/10035191 http://rypress.com/tutorials/object ...
- BAPI_PO_CEATE 与PO_1
- adb获取Android系统属性(adb shell getprop ***)数据来源
在Android系统中,它的根文件系统下有几个用于启动系统时需要的配置文件: /init.rc /default.prop /system/build.prop 通常我们可以通过命令getprop获取 ...
- Hadoop的jobhistoryserver配置
配置mapred-site.xml <configuration> <property> <name>mapreduce.framework.name</na ...
- I.MX6 system.img unpack repack
/************************************************************************* * I.MX6 system.img unpack ...
- public void与public static void区别
我们换个简单易懂的说法,这两句的区别就在于,能不能直接用类名访问. 很好理解的不是吗? 假如,我有一个类,如下图所示: 接下来先实例化一个对象,ca,你会发现它不仅可以访问普通的方法,也可以访问静态的 ...
- kvm_虚拟机迁移
virsh domblklist 虚拟机名称 #查看虚拟磁盘文件 一.kvm虚拟机静态迁移 1.静态迁移就是虚拟机在关机状态下,拷贝虚拟机虚拟磁盘文件与配置文件到目标虚拟主机中,实现的迁移. (1)虚 ...
- 查看mysql状态
命令:mysqladmin -uroot -p -h172.16.0.20 status Uptime: 14317755 Threads: 61 Questions: 187732924 Sl ...
- Mysql基础调优
mysql基础的优化方式 1.利用索引加快查询速度 2.利用查询缓存或者旁挂式缓存,提高访问速度 缓存:k/v key:查询语句的hash值 value:查询语句的执行结果 哪些查询可能不会被缓存? ...