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 (≤10​100​​).

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 分)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 【PAT甲级】1005 Spell It Right (20 分)

    题意: 给出一个非零整数N(<=10^100),计算每位之和并用英文输出. AAAAAccepted code: #include<bits/stdc++.h> using name ...

  6. 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 ...

  7. Day 006:PAT练习--1005 Spell It Right (20 分)

    上星期一直在写报告乱七八糟的,从今天开始不刷乙级的了,还是多刷甲级进步来得快一点! 显而易见,该题的关键在于将输入之和的每一位从高到低输出,这里我们发现题意中的输入数的范围为0-10^100,显然我们 ...

  8. 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 ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. git误提交了项目文件和配置文件的恢复方法

    参考链接:https://my.oschina.net/yangfuhai/blog/708704

  2. PHP多种序列化/反序列化的方法 serialize,json_encode等

    序列化是将变量转换为可保存或传输的字符串的过程:反序列化就是在适当的时候把这个字符串再转化成原来的变量使用.这两个过程结合起来,可以轻松地存储和传输数据,使程序更具维护性. 1.  serialize ...

  3. 升级 macOS Mojave 后部分软件 (如 VS Code) 字体变虚的解决方法

    目前有些朋友的设备可能还是“非 Retina” 显示器,那这样如果升级到 Mojave 后你会发现文字不清晰了,这是因为 Mojave 默认关闭了文字次像素渲染字体,你需要在终端里执行: defaul ...

  4. opencv-python教程学习系列12-图像阈值

    前言 opencv-python教程学习系列记录学习python-opencv过程的点滴,本文主要介绍图像阈值/二值化,坚持学习,共同进步. 系列教程参照OpenCV-Python中文教程: 系统环境 ...

  5. 批处理设置IP地址 - imsoft.cnblogs

    批处理设置IP地址 不知朋友们是否有这样的经历,把本本带到单位上网时,由于单位需要配固定IP地址,而家里是自动获得IP地址的,所以每天都要对这个IP地址设置来设置去,那么有没有简单方便的办法呢?其实我 ...

  6. 八皇后 递归or迭代

    递归: #include <iostream> #include <cstdlib> #include <cstdio> using namespace std; ...

  7. @Transactional + FetchType.LYZY (hibernate) <---> Exception: could not initialize proxy - no Session;

    转自: https://blog.csdn.net/blueheart20/article/details/52912023 4.问题的解决 尝试1:  在Service方法中新增了@Transact ...

  8. Sort An Unsorted Stack

    Given a stack of integers, sort it in ascending order using another temporary stack. Examples: Input ...

  9. LG3812 【模板】线性基

    题意 给定n个整数(数字可能重复),求在这些数中选取任意个,使得他们的异或和最大. \(1≤n≤50,0≤S_i≤2^{50}\) 分析 模板题. 推荐一篇好博客 现在我来证明一下线性基的性质. 性质 ...

  10. ereg()替换为preg_match(),ereg_repalce替换为preg_replace得加斜杠

    PHP 5.3 ereg() 无法正常使用,提示“Function ereg() is deprecated Error”是因为它长ereg 函数进行了升级处理,需要像preg_match使用/ /来 ...