PAT(甲级)1005. Spell It Right (20)
来源:互联网 发布:六年级英语软件 编辑:程序博客网 时间:2024/06/08 11:11
题目:https://www.patest.cn/contests/pat-a-practise/1005
代码:
#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>using namespace std;int main(){char str[10][10]={"zero","one","two","three","four","five","six","seven","eight","nine"};char s[110],a[100];int sum=0,temp;gets(s);int count=strlen(s);for(int i=0;i<count;i++){ temp=s[i]-'0'; sum+=temp;}int k=0;do{ a[k++]=sum%10;sum=sum/10;}while(sum!=0);for(int i=k-1;i>=0;i--){ if(i!=0) printf("%s ",str[a[i]]); else printf("%s",str[a[i]]);} system("pause");}
0 0
- 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(甲级)1005. Spell It Right (20)
- PAT甲级1005. Spell It Right
- PAT 甲级 1005. Spell It Right
- [PAT-甲级]1005.Spell It Right
- PAT甲级1005. Spell It Right
- PAT 甲级 1005. Spell It Right
- 1005. Spell It Right (20)-PAT甲级真题
- 【PAT甲级】【C++】1005. Spell It Right (20)
- PAT TEST 甲级1005. Spell It Right (20)
- PAT甲级练习1005. Spell It Right (20)
- (PAT)1005. Spell It Right (20)
- 使用HttpUrlConnection多线程下载文件
- 几句话实现导航栏透明渐变(iOS)
- android中的线程通信(二)
- the following classes could not be found android.support.v7.internal.
- Microsoft Excel.WsF——U盘里面的隐藏病毒怎么删除
- PAT(甲级)1005. Spell It Right (20)
- linux shell 关键字查找,返回OK 否则NO
- 2017年网站SEO站群类型推荐【干货分享】
- EasyUI combobox 的使用
- 关于是否积案的提示框解决
- NDK编译可执行文件在Android L中运行显示error: only position independent executables (PIE) are supported.失败问题解决办法。
- 学习笔记---多维数组及多级指针的使用
- 度量系列(1)——你真的了解“以数据说话”吗?
- 【wcf】——WCF基础