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<iostream>
#include<stack>
using namespace std;
int main() {
string s;
cin>>s;
stack<int> sta;
int sum=,tmp;
for(int i=;i<s.length();i++){
sum+=(s[i]-'');
}
while(sum!=){
sta.push(sum%);
sum/=;
}
if(sta.empty()) cout<<"zero";
while(!sta.empty()){
tmp=sta.top();
sta.pop();
switch(tmp){
case :cout<<"zero";break;
case :cout<<"one";break;
case :cout<<"two";break;
case :cout<<"three";break;
case :cout<<"four";break;
case :cout<<"five";break;
case :cout<<"six";break;
case :cout<<"seven";break;
case :cout<<"eight";break;
case :cout<<"nine";break;
case :cout<<"ten";break;
}
if(sta.size()!=) cout<<" ";
}
system("pause");
return ;
}

最新文章

  1. 8. apache服务实验笔记
  2. 概率DP light oj 1038
  3. linux优先级、性能监控指令
  4. 【高德地图开发4】---增加覆盖物setMapTextZIndex
  5. noip2007提高组题解
  6. 简易ORM(基于注解)
  7. android开发常用组件(库)推荐
  8. LintCode- 删除排序数组中的重复数字
  9. net搭建热插拔式web框架(沙箱的构建)
  10. LINUX6安装Oracle10g无法启动安装界面解决
  11. Python 命令模式和交互模式
  12. .net 4.0 中的特性总结(四):Tuple类型
  13. Linux 下文件
  14. html随笔CSS(*^__^*)
  15. FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. com/mongodb/util/JSON
  16. SpringMVC之ajax+select下拉框交互常用方式
  17. 珍藏40个android应用源码分享
  18. Spring Cloud 学习网址
  19. Java8 (Function,Consumer,Predicate,Supplier)详解
  20. 在Linux中安装Oracle(较详细图解)

热门文章

  1. [LeetCode]-algorithms-Longest Palindromic Substring
  2. 20175201张驰 实验四 Android 开发
  3. 洛谷P2023 [AHOI2009]维护序列(线段树区间更新,区间查询)
  4. 修改web项目发布路径
  5. Nova 的高性能虚拟机支撑
  6. C# 获取当前网页HTML
  7. cobbler批量安装系统
  8. mysql安装及相关配置
  9. 5.使用github脚本LAZY----几个最好的发行版----自定义终端----基本命令
  10. python调用java所有代码都要放在jvm开启的时候调用,否则报错: No matching overloads found for in find. at native\common\jp_method.cpp:127