Hastiness

Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1793 Accepted Submission(s): 693

Problem Description
How many problems did you AC?
When you read this problem, don’t hasty and careless, this is also simple, haha, I didn’t cheat you.
The game over soon, WisKey starts using English begin countdown. He not only have no gene in math, but also bad in English. Fortunately, He met you who have gift in programming. So please help him to translate.

Input
Give you an integer T, output T in English, and note that all of words are lower case. (0<=T<=9999)

Output
One answer One line.
Details see sample.

Sample Input
2034
1234
123
24
0Sample Output
two thousand and thirty-four
one thousand and two hundred and thirty-four
one hundred and twenty-three
twenty-four
zeroAuthor
威士忌Source
HZIEE 2007 Programming Contest

模拟模拟,

*#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{char a[100][100];strcpy(a[0],"zero");strcpy(a[1],"one");strcpy(a[2],"two");strcpy(a[3],"three");strcpy(a[4],"four");strcpy(a[5],"five");strcpy(a[6],"six");strcpy(a[7],"seven");strcpy(a[8],"eight");strcpy(a[9],"nine");strcpy(a[10],"ten");strcpy(a[11],"eleven");strcpy(a[12],"twelve");strcpy(a[13],"thirteen");strcpy(a[14],"fourteen");strcpy(a[15],"fifteen");strcpy(a[16],"sixteen");strcpy(a[17],"seventeen");strcpy(a[18],"eighteen");strcpy(a[19],"nineteen");strcpy(a[20],"twenty");strcpy(a[30],"thirty");strcpy(a[40],"forty");strcpy(a[50],"fifty");strcpy(a[60],"sixty");strcpy(a[70],"seventy");strcpy(a[80],"eighty");strcpy(a[90],"ninety");int k,x,y,z,t;while(scanf("%d",&k)!=EOF){if(k/1000!=0){x=k/1000;printf("%s thousand",a[x]);y=k/100%10;if(y!=0)printf(" and %s hundred",a[y]);z=k/10%10;t=k%10;if(z==0){if(t==0){printf("\n");continue;}printf(" and %s\n",a[t]);continue;}else if(z==1){z=k%100;printf(" and %s\n",a[z]);continue;}else{if(t==0){printf(" and %s\n",a[k%100]);continue;}printf(" and %s-%s\n",a[z*10],a[t]);continue;}}else if(k/100!=0){y=k/100%10;if(y!=0)printf("%s hundred",a[y]);z=k/10%10;t=k%10;if(z==0){if(t==0){printf("\n");continue;}printf(" and %s\n",a[t]);continue;}else if(z==1){z=k%100;printf(" and %s\n",a[z]);continue;}else{if(t==0){printf(" and %s\n",a[k%100]);continue;}printf(" and %s-%s\n",a[z*10],a[t]);continue;}}else if(k/10!=0){z=k/10%10;t=k%10;if(z==0){if(t==0){printf("\n");continue;}printf("%s\n",a[t]);continue;}else if(z==1){z=k%100;printf("%s\n",a[z]);continue;}else{if(t==0){printf("%s\n",a[k%100]);continue;}printf("%s-%s\n",a[z*10],a[t]);continue;}}elseprintf("%s\n",a[k]);}return 0;
}

转载于:https://www.cnblogs.com/nanfenggu/p/7899984.html

HDU 1727 Hastiness(模拟)相关推荐

  1. HDU 4121 Xiangqi 模拟题

    题目: http://acm.hdu.edu.cn/showproblem.php?pid=4121 首先对标题赞一个,非要叫 "Xiangqi" 而不是 "中国象棋&q ...

  2. HDU 5374 Tetris 模拟俄罗斯方块

    题目大意: 就是俄罗斯方块然后旋转, 向左右移动, 向下掉, 然后模拟求按照给定序列的操作能消除多少行... 大致思路: 就是模拟一下各个步骤的操作...按照题目说的steep1, 2, 3, 4一步 ...

  3. HDU 4262 Juggler (模拟+线段树优化)

    转载请注明出处,谢谢http://blog.csdn.net/acm_cxlove/article/details/7854526       by---cxlove http://acm.hdu.e ...

  4. HDU 4121 Xiangqi --模拟

    题意: 给一个象棋局势,问黑棋是否死棋了,黑棋只有一个将,红棋可能有2~7个棋,分别可能是车,马,炮以及帅. 解法: 开始写法是对每个棋子,都处理处他能吃的地方,赋为-1,然后判断将能不能走到非-1的 ...

  5. hdu 5071 Chat(模拟|Splay)

    Chat Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Sub ...

  6. HDU 4431 Mahjong(模拟题)

    题目链接 写了俩小时+把....有一种情况写的时候漏了...代码还算清晰把,想了很久才开写的. 1 #include <cstdio> 2 #include <cstring> ...

  7. HDU 4545 (模拟) 魔法串

    题目链接 Problem Description 小明和他的好朋友小西在玩一个新的游戏,由小西给出一个由小写字母构成的字符串,小明给出另一个比小西更长的字符串,也由小写字母组成,如果能通过魔法转换使小 ...

  8. hdu 5671(模拟)

    Matrix Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total S ...

  9. 今夕何夕 HDU - 6112 ( 模拟 )

    今夕何夕 今天是2017年8月6日,农历闰六月十五. 小度独自凭栏,望着一轮圆月,发出了"今夕何夕,见此良人"的寂寞感慨. 为了排遣郁结,它决定思考一个数学问题:接下来最近的哪一年 ...

最新文章

  1. 人脸识别数据集精粹(上)
  2. 机器学习研究人员需要学习8种神经网络架构
  3. 关于mina的setSendBufferSize体验
  4. 零基础如何学python-零基础小白如何学python,想请教大家,求指导 ?
  5. VTK:可视化之LineWidth
  6. centos远程mc服务器,Centos7 下最最最简单的部署 MC 服务器超轻松学废
  7. unitec理工学院 计算机,2020年新西兰留学Unitec理工学院计算机硕士课程全面解析...
  8. java中通过反射得到StatusBarManager
  9. 【收藏版】长文详解基于并行计算的条件随机场
  10. mysql msi失败_MySQL .msi 安装失败改用.zip安装步骤
  11. HTML静态网页作业——仿天猫购物商城(7页) 网页设计作业,网页制作作业, 学生网页作业, 网页作业成品, 网页作业模板
  12. SQL中的升序和降序
  13. Python实现快递分拣小程序(附源码和超详细注释)
  14. poco库 文件服务器,poco
  15. android开发中磁场传感器,Android传感器(加速度传感器,磁场传感器,光线传感器,方向传感器)...
  16. Excel数据分析常用函数②——统计函数(sumproduct,sumif,sumifs,count,countif,countifs,counta…)
  17. chrome调试与设置 remote设备调试
  18. free software
  19. 微分,梯度及梯度下降法
  20. web前端开发面试题(一)

热门文章

  1. Xcode6中使用initWithTitle:title image:image selectedImage:自定义图片
  2. Week1 Team Homework #2 Introduction of team member with photos
  3. ad network
  4. 如何用distinct消除重复记录的同时又能选取多个字段值?
  5. mac环境下node.js和phonegap/cordova创建ios和android应用
  6. nodejs实现文件上传
  7. Python 杨辉三角形的简单实现
  8. 洛谷1052——过河(DP+状态压缩)
  9. ComblockEngine 引擎实践
  10. hbase里插入big int数据用Phoenix查看的报错问题