博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
1005 Spell It Right (20 分)
阅读量:4348 次
发布时间:2019-06-07

本文共 1260 字,大约阅读时间需要 4 分钟。

1005 Spell It Right (20 分)

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 (10100​​).

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 分析:水题
1 /** 2 * Copyright(c) 3 * All rights reserved. 4 * Author : Mered1th 5 * Date : 2019-02-24-20.08.51 6 * Description : A1005 7 */ 8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 #include
15 #include
16 #include
17 #include
18 using namespace std;19 string a[10]={ "zero","one","two","three","four","five","six","seven","eight","nine"};20 int main(){21 #ifdef ONLINE_JUDGE22 #else23 freopen("1.txt", "r", stdin);24 #endif25 string s;26 cin>>s;27 int sum=0,len=s.length();28 for(int i=0;i

 

转载于:https://www.cnblogs.com/Mered1th/p/10427679.html

你可能感兴趣的文章
CRC码计算及校验原理的最通俗诠释
查看>>
jquery扩展 $.fn
查看>>
机器分配
查看>>
Windows下安装Redis
查看>>
winform非常实用的程序退出方法!!!!!(转自博客园)
查看>>
centos安装vim
查看>>
linux工作调度(计划任务)
查看>>
NIO:与 Buffer 一起使用 Channel
查看>>
Android帧缓冲区(Frame Buffer)硬件抽象层(HAL)模块Gralloc的实现原理分析
查看>>
MFC接收ShellExecute多个参数
查看>>
volatile和synchronized的区别
查看>>
类中的静态函数和非静态函数的区别
查看>>
windows 下安装Apache
查看>>
Fedora14 mount出现错误时解决办法【亲测有效】
查看>>
ruby实现生产者和消费者
查看>>
node.js 之 http 架设
查看>>
MongoDB 备份与还原
查看>>
Oracle启动与关闭数据库实例
查看>>
Spring day01
查看>>
hihocoder-1740-替换函数
查看>>