1005.Spell It Right (20)
来源:互联网 发布:win7允许网络访问 编辑:程序博客网 时间:2024/05/16 15:21
考查知识点:字符串处理
//思路:这题跟乙级1002很像,注释就不写了,╮(╯▽╰)╭,人越来越懒了,还不懂得就留言吧,,,
#include<cstdio>#include<cstring>#include<iostream>using namespace std;int main(){ char N[105]; gets(N); int len=strlen(N); int sum=0; for(int i=0;i<len;i++) sum+=(N[i]-'0'); char spell[10][7]={"zero","one","two","three","four","five","six","seven", "eight","nine"}; int divice[5]={0},k; if(sum==0) divice[k++]=sum%10; while(sum){ divice[k++]=sum%10; sum/=10; } for(int i=k-1;i>=0;i--){ printf("%s", spell[divice[i]]); if(i!=0) putchar(' '); } return 0;}
0 0
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 1005. Spell It Right (20)
- 在iOS开发中使用正则表达式分解字符串
- 打地鼠游戏
- HDU 5512 Pagodas
- Spring Boot学习记录(二)--thymeleaf模板
- linux 基本操作:
- 1005.Spell It Right (20)
- 关于用Getline读取文件只能读取首行的问题
- 如何生成可导入数据库的亿级别数据
- File Watcher,不只是一个工具
- CENTOS 7.2 使用 RDO 安装 OPENSTACK
- 151. Reverse Words in a String
- linux下grep用法
- MATLAB数学建模(6)-蒙特卡洛算法
- HDU 1402及51 nod1028 大数乘法 V2(FFT 快速傅里叶变换)