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
分析:水题
/** * Copyright(c) * All rights reserved. * Author : Mered1th * Date : 2019-02-24-20.08.51 * Description : A1005 */ #include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<algorithm> #include<string> #include<unordered_set> #include<map> #include<vector> #include<set> using namespace std; ]={"zero","one","two","three","four","five","six","seven","eight","nine"}; int main(){ #ifdef ONLINE_JUDGE #else freopen("1.txt", "r", stdin); #endif string s; cin>>s; ,len=s.length(); ;i<len;i++){ sum+=s[i]-'; } string ans=to_string(sum); ;i<ans.size();i++){ cout<<a[ans[i]-']; ) printf(" "); } ; }
1005 Spell It Right (20 分)的更多相关文章
- 1005 Spell It Right (20分)
1005 Spell It Right (20分) 题目: Given a non-negative integer N, your task is to compute the sum of all ...
- PAT (Advanced Level) Practice 1005 Spell It Right (20 分) 凌宸1642
PAT (Advanced Level) Practice 1005 Spell It Right (20 分) 凌宸1642 题目描述: Given a non-negative integer N ...
- PAT Advanced 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 e ...
- PAT (Advanced Level) Practice 1005 Spell It Right (20 分) (switch)
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output e ...
- 【PAT甲级】1005 Spell It Right (20 分)
题意: 给出一个非零整数N(<=10^100),计算每位之和并用英文输出. AAAAAccepted code: #include<bits/stdc++.h> using name ...
- 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 e ...
- Day 006:PAT练习--1005 Spell It Right (20 分)
上星期一直在写报告乱七八糟的,从今天开始不刷乙级的了,还是多刷甲级进步来得快一点! 显而易见,该题的关键在于将输入之和的每一位从高到低输出,这里我们发现题意中的输入数的范围为0-10^100,显然我们 ...
- PTA 1005 Spell It Right (20)(20 分)水题
1005 Spell It Right (20)(20 分) Given a non-negative integer N, your task is to compute the sum of al ...
- PAT 甲级 1005 Spell It Right (20)(代码)
1005 Spell It Right (20)(20 分) Given a non-negative integer N, your task is to compute the sum of al ...
- PAT 甲 1005. Spell It Right (20) 2016-09-09 22:53 42人阅读 评论(0) 收藏
1005. Spell It Right (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given ...
随机推荐
- DevExpress v17.2新版亮点—Windows 10篇
用户界面套包DevExpress v17.2日前终于正式发布,本站将以连载的形式为大家介绍各版本新增内容.本文将介绍了Windows 10 Controls v17.2 的新功能,快来下载试用新版本! ...
- Word文档加密小技巧
文件菜单设置: 1.打开需要加密的Word文档. 2.选“文件”的“另存为”,出现“另存为”对话框,在“工具”中选“常规选项”,出现“保存”选项卡. 3.分别在“打开权限密码”和“修改权限密码”中输入 ...
- 374. Guess Number Higher or Lower 简单的二分法运用
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to gues ...
- ZOJ 2965 Accurately Say "CocaCola"!
Time Limit: 2 Seconds Memory Limit: 65536 KB In a party held by CocaCola company, several stude ...
- HslControls组件库 工业控件库 曲线控件 时间控件 管道控件 温度计控件 阀门控件 传送带控件 进度条控件 电池控件 数码管控件等等
本篇博客主要对 HslControls 组件做一个大概的总览介绍,更详细的内容可以参照页面里的子链接,还有github上的源代码,然后进行相关的学习,和使用. Prepare 先从nuget下载到组件 ...
- Linux/Unix下Shell快捷键操作集合
本人收集整理了一些Bash或其他Shell中常用的快捷键,使用技巧以及Ubuntu中一些常用操作的快捷键,希望大家能从中受益,提高工作效率. 使用”!”从历史中执行命令 有时候,我们需要在 Bash ...
- 怎样取消老毛桃软件赞助商---只需在输入框中输入老毛桃官网网址“laomaotao.org”
来源:www.laomaotao.org 时间:2015-01-29 在众多网友和赞助商的支持下,迄今为止,老毛桃u盘启动盘制作工具已经推出了多个版本.如果有用户希望取消显示老毛桃软件中的赞助商,那不 ...
- 51Nod:1086背包问题 V2
1086 背包问题 V2 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 有N种物品,每种物品的数量为C1,C2......Cn.从中任选若干件放在容量为W的背包里 ...
- 【java编程】java对象copy
实现java对象Copy的三种方式 一.克隆 implements Cloneable 二.序列化 implements Serializable 三.利用反射机制copy apache的BeanUt ...
- silverlight 中javascript 代码与托管代码的互调用 以及一些思考
silverlight 客户端javascript 代码与托管代码的互调用时比较用意义的同时,因为silverlight本身就是一个插件,如果两者之间不能进行相互的调用,对于web 上的一些特殊的功能 ...