简单题。

  1. #include<iostream>
  2. #include<cstring>
  3. #include<cmath>
  4. #include<algorithm>
  5. #include<cstdio>
  6. #include<vector>
  7. using namespace std;
  8.  
  9. const int maxn=+;
  10. char s[maxn];
  11. int tmp[maxn],tot;
  12. char ans[][]={
  13. "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"
  14. };
  15.  
  16. int main()
  17. {
  18. scanf("%s",s);
  19. int num=; for(int i=;s[i];i++) num=num+s[i]-'';
  20. if(num==)
  21. {
  22. printf("zero\n");
  23. }
  24. else{
  25. tot=; while(num) tmp[tot++]=num%,num=num/;
  26. for(int i=tot-;i>=;i--)
  27. {
  28. printf("%s",ans[tmp[i]]);
  29. if(i>) printf(" ");
  30. else printf("\n");
  31. }
  32. }
  33. return ;
  34. }

PAT (Advanced Level) 1005. Spell It Right (20)的更多相关文章

  1. PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: ...

  2. PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...

  3. PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642 题目描述: Being unique is so important to peo ...

  4. PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642 题目描述: A reversible prime in any n ...

  5. PTA (Advanced Level) 1005 Spell It Right

    Spell It Right Given a non-negative integer N, your task is to compute the sum of all the digits of  ...

  6. PAT (Advanced Level) Practice 1152 Google Recruitment (20 分)

    In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the p ...

  7. PAT (Advanced Level) 1054. The Dominant Color (20)

    简单题 #include<cstdio> #include<cstring> #include<cmath> #include<vector> #inc ...

  8. PAT (Advanced Level) 1027. Colors in Mars (20)

    简单题. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> ...

  9. PAT (Advanced Level) 1019. General Palindromic Number (20)

    简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> ...

随机推荐

  1. Linux教程之配置权限受限制的SFTP

    SFTP 在Linux下是一个很方便很安全的文件传输工具,我常常用它在Linux服务器上替代传统的ftp来传输文件.众所周知SFTP账号是基于SSH账号的,默认情况下访问服务器的权限很大,下面的教程就 ...

  2. Sublime text 3 如何格式化HTML代码

    使用Sublime text 3 编写代码是一种享受,使用Sublime text 3 格式化HTML代码,需要安装插件,具体安装步骤如下:   1.打开菜单->首选项->插件控制,输入 ...

  3. nginx proxy优化

    常用优化要点 当nginx用于反向代理时,每个客户端将使用两个连接: 一个用于响应客户端的请求,另一个用于到后端的访问: 如果机器是两核CPU,例如: 1 2 $ grep ^proces /proc ...

  4. HDU5908 Abelian Period 暴力

    题目大意:将一个数组分成长度为k的几个连续区间,如果每个区间内各个元素出现的次数相同,则称k为一个阿贝尔周期,从小到大打印所有阿贝尔周期,数据间加空格. 题目思路:map+暴力 #include< ...

  5. ios 获得版本号

    获取iphone的系统信息使用[UIDevice currentDevice],信息如下: [[UIDevice currentDevice] systemName]:系统名称,如iPhone OS ...

  6. A New Change Problem

    题目链接 /* 给定两个互质的数,a,b,求这两个数不能表示的数的最大值和个数. 最大值=a*b-a-b; 个数 =(a-1)*(b-1)/2; */ #include <set> #in ...

  7. Jenkins+SonarQube代码质量检查自动化

    基础概念百度百科:Jenkins是基于Java开发的一种持续集成工具,用于监控持续重复的工作,功能包括:1.持续的软件版本发布/测试项目.2.监控外部调用执行的工作.前面[Sonarqube 代码质量 ...

  8. HDU1874 最短路 SPFA

    最短路 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 24  Solved: 17 [Submit][Status][Web Board] Descr ...

  9. Mysql主从备份、主主备份

    简单介绍mysql双机,多机异地热备简单原理实战. 双机热备的概念简单说一下,就是要保持两个数据库的状态自动同步.对任何一个数据库的操作都自动应用到另外一个数据库,始终保持两个数据库数据一致. 这样做 ...

  10. 转:浏览器与WEB服务器工作过程举例

    用户通过“浏览器”访问因特网上的WEB服务器,浏览器和服务器之间的信息交换使用超文本传输协议(HTTP--HyperText Transfer Protocol). 例:用户访问东南大学主页 Http ...