pat 1005. Spell It Right (20)
来源:互联网 发布:装修效果图设计软件 编辑:程序博客网 时间:2024/06/04 19:43
简单题
#include <iostream>#include <cstring>using namespace std;#include <stack>int main(){ ios::sync_with_stdio(false); stack<int>s; string a; string res[10] = {"zero","one","two","three","four","five","six","seven","eight","nine"}; int sum=0; cin>>a; for(int i=0;i<a.size();i++){ sum += a[i]-'0'; } if(!sum) s.push(0); int tmp; while(sum){ tmp = sum%10; sum /= 10; s.push(tmp); } while(s.size()){ tmp = s.top(); s.pop(); cout<<res[tmp]; if(s.size()) cout<<" "; } return 0;}
阅读全文
0 0
- (PAT)1005. Spell It Right (20)
- PAT 1005. Spell It Right (20)
- PAT: 1005. Spell It Right (20)
- PAT A 1005. Spell It Right (20)
- PAT 1005. Spell It Right (20)
- [PAT]1005. Spell It Right (20)
- PAT 1005. Spell It Right (20)
- pat 1005. Spell It Right (20)
- [PAT]1005. Spell It Right (20)
- PAT 1005. Spell It Right (20)
- PAT - 甲级 - 1005. Spell It Right (20)
- PAT(A) - 1005. Spell It Right (20)
- pat-a 1005. Spell It Right (20)
- PAT甲级.1005. Spell It Right (20)
- PAT 甲 1005. Spell It Right (20)
- 【PAT甲级】1005. Spell It Right (20)
- PAT A 1005. Spell It Right (20)
- PAT-A 1005. Spell It Right (20)
- kube-proxy工作原理
- BZOJ 1122: [POI2008]账本BBB
- Picked up _JAVA_OPTIONS: -Xmx900M”
- C语言实现:合并两个有序的数组,合并后的数组依然有序
- com.alibaba.druid:type=DruidDataSourceStat报错
- pat 1005. Spell It Right (20)
- 【POJ】最小差值
- MFC 集成 Caffe导出的dll文件做人脸识别
- 4. 如何使用SolidWorks软件导出URDF机器人模型文件
- Kafka Creating Topic Error: replication factor larger than available brokers
- php设置报错级别,项目后台使用YII框架开发
- nanopi 烧写系统+连接wifi+stfp
- 5. 编码器与PID控制
- IntelliJ IDEA For Mac 快捷键