pat1005 Spell It Right
来源:互联网 发布:淘宝卖家发货地怎么改 编辑:程序博客网 时间:2024/05/22 13:02
#include<cstdio>#include<iostream>#include<algorithm>#include<vector>#include<queue>#include<string>#include<cstring>#include<cmath>using namespace std;string a[10] = {"zero","one","two","three","four","five","six","seven","eight","nine"};int ans[100];int main(){ string s; cin>>s; int sum = 0; for(int i = 0;i<s.length();i++)sum+=s[i]-'0'; int cnt = 0; while(sum) { ans[cnt++] = sum%10; sum/=10; } for(int i = cnt-1;i>0;i--)cout<<a[ans[i]]<<" "; cout<<a[ans[0]]<<endl; system("pause"); return 0;}
0 0
- PAT1005.Spell It Right
- PAT1005. Spell It Right
- pat1005 Spell It Right
- PAT1005-Spell It Right
- PAT1005. Spell It Right (20)
- PAT1005. Spell It Right (20)
- PAT1005. Spell It Right (20)
- PAT1005. Spell It Right (20)
- PAT1005. Spell It Right (20)
- PAT1005 Spell It Right 大水题
- 1005. Spell It Right
- 1005. Spell It Right
- PAT_1005: Spell It Right
- 1005. Spell It Right
- 1005.Spell It Right
- 1005. Spell It Right
- Spell It Right
- Spell It Right
- Graph Algorithms
- HDOJ 1201 18岁生日
- java8改进的接口
- css3绘制3d翻页效果
- 背包问题九讲笔记_多重背包
- pat1005 Spell It Right
- 精益编程:在短期项目中使用看板与持续改进
- 【JAVA实现】K-means聚类算法
- Android常用类库说明
- 菜单(四)给ListView的item添加上下文菜单
- poj 1091 (容斥原理)
- 内存管理算法--伙伴算法
- Doctrine-对象关系映射(ORM)中文版
- SDUT 2135----排队买饭(队列)