Spell It Right
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.
Input Specification:
Each input file contains one test case. Each case occupies one line which contains an N (≤).
Output Specification:
For each test case, output in one line the digits of the sum in English words. There must be one space between two consecutive words, but no extra space at the end of a line.
Sample Input:
12345
Sample Output:
one five
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
char n[];
char str[];
char *m[]={"zero","one","two","three","four","five","six","seven","eight","nine"};
int temp,sum=,i=;
scanf("%s",n);
for(i=;i<strlen(n);i++){
temp=n[i]-'';
sum+=temp;
}
sprintf(str,"%d",sum);
int b=str[strlen(str)-]-'';
for(i=;i<strlen(str)-;i++){
int a=str[i]-'';
printf("%s ",m[a]);
}
printf("%s",m[b]);
return ;
}
Spell It Right的更多相关文章
- Spell checker
Spell checker Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Subm ...
- [solr] - spell check
solr提供了一个spell check,又叫suggestions,可以用于查询输入的自动完成功能auto-complete. 参考文献: https://cwiki.apache.org/conf ...
- poj 1035 Spell checker
Spell checker Time Limit: 2000 MS Memory Limit: 65536 KB 64-bit integer IO format: %I64d , %I64u J ...
- Spell checker(暴力)
Spell checker Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 20188 Accepted: 7404 De ...
- 1.7.7 Spell Checking -拼写检查
1. SpellCheck SpellCheck组件设计的目的是基于其他,相似,terms来提供内联查询建议.这些建议的依据可以是solr字段中的terms,外部可以创建文本文件, 或者其实lucen ...
- POJ1035——Spell checker(字符串处理)
Spell checker DescriptionYou, as a member of a development team for a new spell checking program, ar ...
- ZOJ-3380 Patchouli’s Spell Cards DP, 组合计数
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3380 题意:有m种不同的元素,每种元素都有n种不同的相位,现在假 ...
- VIM 拼写/spell check
VIM 拼写检查/spell check 一.Hunspell科普 Hunspell 作为一个拼写检查的工具,已经用在了许多开源的以及商业软件中.包括Google Chrome, Libreoffic ...
- spell checking
Spell checker Description You, as a member of a development team for a new spell checking program, a ...
- [LeetCode] Stickers to Spell Word 贴片拼单词
We are given N different types of stickers. Each sticker has a lowercase English word on it. You wou ...
随机推荐
- python获取参数列表
def f(a=1, b=2, c=3): print(locals())#在函数内获取 #使用inspect模块,简单方便 python2.7: import inspectinspect.geta ...
- es6 promise 所见
一.Promise是什么? Promise 是异步编程的一种解决方案: 从语法上讲,promise是一个对象,从它可以获取异步操作的消息:从本意上讲,它是承诺,承诺它过一段时间会给你一个结果. pro ...
- HDU 2887 Watering Hole(MST + 倍增LCA)
传送门 总算是做上一道LCA的应用题了... 题意:有$n$个牧场, $m$根管道分别连接编号为$u,v$的牧场花费$p_{i}$,在第$i$个牧场挖口井需要花费$w_{i}$,有$P$根管道直接连通 ...
- springboot(三)
SpringBoot 整合JdbcTemplate 1.创建一个springboot_jdbc项目 2.导入依赖 <dependency> <groupId>org.spri ...
- learning at command AT+CFUN
[Purpose] Learning how to controls the functionality level. It can also be used to reset the UE (飞行模 ...
- hibernate的持久化类、主键生成策略
一.hibernate的持久化类 1.什么是持久化类: 持久化:将数据存储到关系型数据库. 持久化类:与数据库中的数据表建立了某种关系的java类.(持久化类=javabean+映射配置文件) 2.持 ...
- c++ Size capacity Resize reserve shrink_to_fit
- Codeforces 1163E Magical Permutation [线性基,构造]
codeforces 思路 我顺着图论的标签点进去的,却没想到-- 可以发现排列内每一个数都是集合里的数异或出来的. 考虑答案的上界是多少.如果能用小于\(2^k\)的数构造出\([0,2^k-1]\ ...
- hhhhh我进步啦!
不要相信上面的标题,其实我是 一直都很强的 蒟蒻中的蒟蒻(卑微☹) 今天早上刷完水题后突然发现自己竟然进了一本通网站“排名”的首页(第 100 名欸),不禁 嘚瑟 开森不已. ☟☟☟ 继续A题↖(^ω ...
- Kerberos(一) 安装
1.服务器基本信息 操作系统:centos7 数量:2 主机名映射关系 IP hostname server 192.168.4.50 manager1 Kerberos server(kdc) 19 ...