简单题。

#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std; const int maxn=+;
char s[maxn];
int tmp[maxn],tot;
char ans[][]={
"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"
}; int main()
{
scanf("%s",s);
int num=; for(int i=;s[i];i++) num=num+s[i]-'';
if(num==)
{
printf("zero\n");
}
else{
tot=; while(num) tmp[tot++]=num%,num=num/;
for(int i=tot-;i>=;i--)
{
printf("%s",ans[tmp[i]]);
if(i>) printf(" ");
else printf("\n");
}
}
return ;
}

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. Spring Security教程

    原文地址:http://blog.csdn.net/jaune161/article/details/17640071 http://blog.csdn.net/jaune161/article/de ...

  2. Linux添加用户user到用户组group

    添加用户:useradd niot 添加到组:usermod -a -G root niot 改密码:passwd niot 切换:su - niot 查看用户组:groups 将一个用户添加到用户组 ...

  3. unity3d自带帮助文档的打开方法

    1废话不提,直接上图: 2.在弹出来的浏览器窗口中点击: 3.在点击后的网页中即可以搜索了,在断网的情况下,作为资料查询还是蛮不错的.

  4. cakephp 复杂查询

    $now = time(); $this->CardTypeInfos->recursive = -1; $conditions = [ 'seller_id'=>SELLER_ID ...

  5. 128M小内存VPS优化与typecho环境搭建

    在使用Haphost提供的128M内存的VPS建站时,debian7+wordpress+nginx+mysql跑起来相当吃力.然后使用Debian7+typecho+lighttpd+sqlite的 ...

  6. Android 开发——如何显示 GIF 动画

    gif 图动画在 android 中还是比较常用的,比如像新浪微博中,有很多 gif 图片,而且展示非常好,所以我也想弄一个.经过我多方的搜索资料和整理,终于弄出来了,其实 github 上有很多开源 ...

  7. css05 字体以及行间距

    <head><meta charset="utf-8"><title>无标题文档</title><style>#box{ ...

  8. 问题:FF中把UL下的LI设为左浮动UL的背景色就没有了?

    因为容器的子元素设置浮动后, 内容移出了文档流!  解决办法: 1.给个overflow:hidden;作为闭合浮动元素2.设定UL 一个固定的高度 下面是一些与之相关的解决办法,参考文章<那些 ...

  9. gulp相关知识(2)

    将之前的东西的理论部分整理了一下—— gulp 前端构建工具 它可以帮助我们完成一些自动化操作 它需要一些插件的支持 var gulp = require('gulp'); --> gulp命令 ...

  10. acm课程练习2--1002

    题目描述 Now, here is a fuction:  F(x) = 6 * x^7+8x^6+7x^3+5x^2-yx (0 <= x <=100)Can you find the ...