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 ...
随机推荐
- shell脚本中向hive动态分区插入数据
在hive上建表与普通分区表创建方法一样: CREATE TABLE `dwa_m_user_association_circle`( `device_number` string, `oppo_nu ...
- Vue.js not detected
安装vue devtools工具,在chrome中一直是灰色,title是Vue.js not detected ① F12关闭开发者模式 ② 刷新 ③ 然后再按F12就好了 网上看到的,居然真的有用 ...
- (1)WIFI信号确定距离
https://blog.csdn.net/PINGER0077/article/details/79482238 ESP8266不需要修改任何库 #include "ESP8266WiFi ...
- L1443
一,看题 1,题不难,但是这个马怎么走,着实搞懵我了. 2,转过去就发现,其实变一下dx,dy就ok. 3,除了输出外似乎也没什么坑. 4,其实也是有的,这个步数也是... 5,作为一道提高-的搜索题 ...
- asp.net web开发——文件的上传和下载
HTML部分 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.a ...
- centos 较新版本kernel安装方法
有时因为系统内核的bug 我们必须要安装新版本的kernel 来解决问题,有几种方法 源码编译 使用编译好的包 使用包的方式比较方便,同时一些依赖的问题可以自动帮助我们处理 添加yum 源 rpm - ...
- [codewars] - int32 to IPv4 二进制十进制 ip地址转换
原题 https://www.codewars.com/kata/int32-to-ipv4/train/java Take the following IPv4 address: 128.32.10 ...
- CF1172E Nauuo and ODT
CF1172E Nauuo and ODT 神仙题orz 要算所有路径的不同颜色之和,多次修改,每次修改后询问. 对每种颜色\(c\)计算多少条路径包含了这个颜色,不好算所以算多少条路径不包含这个颜色 ...
- Git命令相关
特别说明 关于命令行中参数前面的-和--的区别 - 通常后面接参数的缩写 -- 通常后面接参数的全拼 eg: git status --short 等价于 git status -s 常用命令 创建版 ...
- 【大数据应用技术】作业十一|分布式并行计算MapReduce
本次作业在要求来自:https://edu.cnblogs.com/campus/gzcc/GZCC-16SE2/homework/3319 1.用自己的话阐明Hadoop平台上HDFS和MapRe ...