我是靠谱客的博主 等待睫毛膏,这篇文章主要介绍输入int123,输出string一百二十三,假设最大是亿。,现在分享给大家,希望可以做个参考。

#include <stdio.h>
#include <math.h>
void main()
{
char *a[7]={"0","0","十","百","千","万","亿"};
char *b[10]={"0","一","二","三","四","五","六","七","八","九"};
int i,n,num=0,temp;
scanf("%d",&n);
temp = n;
while(temp!=0)
{
temp=temp/10;
num++;
}
temp = n;
while(temp!=0)
{
i=temp/(pow(10,(num-1)));
printf("%s",b[i]);
if(num>1)
{
printf("%s",a[num]);
}
temp=temp-i*(pow(10,(num-1)));
num--;
}
printf("n");
}

最后

以上就是等待睫毛膏最近收集整理的关于输入int123,输出string一百二十三,假设最大是亿。的全部内容,更多相关输入int123内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(122)

评论列表共有 0 条评论

立即
投稿
返回
顶部