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 ...
随机推荐
- Python 编程核心知识体系-模块|面向对象编程(三)
模块 面向对象编程
- Ubuntu使用Remastersys封装制作系统ISO镜像
首先下载Remastersys的Deb软件包 链接:http://pan.baidu.com/s/1i3tYPKT 密码:qvyd 使用命令强制安装 dpkg --force-all -i remas ...
- [转载]三款SDR平台对比:HackRF,bladeRF和USRP
这篇文章是 Taylor Killian 13年8月发表在自己的博客上的.他对比了三款平价的SDR平台,认为这三款产品将是未来一年中最受欢迎的SDR平台.我觉得这篇文章很有参考价值,简单翻译一份转过来 ...
- Code Sign error: Provisioning profile XXXX can't be found
[iphone]Code Sign error: Provisioning profile XXXX can't be found 如果你更新了profile,再编译iphone项目,发现下面的错误, ...
- ARM裸板开发:07_IIC 通过IIC总线接口读写时钟芯片时间参数实现的总结
问题一:程序直接在iRAM内部可正常执行,而程序搬移(Nand ->SDRAM)之后,就不能正常运行了 #define NAND_SECTOR_SIZE 2048 /* 读函数 */ void ...
- UIActivityIndicatorView使用
UIActivityIndicatorView显示一个标准的旋转进度轮,类似网页AJAX加载时的图标. let loadIndicator = UIActivityIndicatorView(fram ...
- OO面向对象多线程编程作业总结
第五次作业:多线程电梯调度 设计策略 在本次电梯作业当中,我构造了一个电梯请求队列线程,一个调度器线程,三个电梯线程,一个文件输出线程,还有主线程. 调度器扫描用户的请求队列,将每个队列分配给 ...
- iOS-----推送机制(上)
推 送 机 制 使用NSNotificationCenter通信 NSNotificationCenter实现了观察者模式,允许应用的不同对象之间以松耦合的方式进行通信. NSNotification ...
- Ubuntu忘记root密码的解决方法
如果是Linux操作系统的话,其实也是很简单 -- 单用户登陆.下面以Ubuntu14.04来简单演示一下具体的操作流程. 1. 开机 2. 此时会有一个选项:Advanced Options for ...
- Unity插件-ShareSDK使用指南
Unity插件ShareSDK使用教程 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 1 Summariz ...