用C语言实现人民币大小写转换
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
for(q=-1;q>=-2;q--)
{
j=s/pow(10,q);
g=(int)j%10;
if(g!=0)
printf("%s%s",a[g-1],d[-q-1]);}
}
第二种:
#include "stdio.h"
#include "stdlib.h"
void main()
{char *a[]={"壹","贰","叁","肆","伍","陆","柒","捌","玖"};
k=i;
}
s=i;
if (k==0)
for(j=0;j<i;j++)
{g=c[j];
if (atoi(&g)!=0)
printf("%s%s",a[atoi(&g)-1],b[s-1]);
s--;}
else
{ i=k;
for(j=0;j<=k;j++)
{g=c[j];
if (atoi(&g)!=0)
char *d[]={"角","分"};
scanf("%f",&s);
s=s+0.003;
for(百度文库=8;i>0;i--)
{j=s/pow(10,i);
if(j!=0)
break;
}
for(q=i-1;q>=0;q--)
{j=s/pow(10,q);
g=(int)j%10;
if(g!=0)
printf("%s%s",a[g-1],b[q]);}
第一种:
#include "stdio.h"
#include "math.h"
void main()
{
float s,j;
int i,q,g;
char *a[]={"壹","贰","叁","肆","伍","陆","柒","捌","玖"};
char *b[]={"元","十","百","千","万","十万","百万","千万","亿"};
char *b[]={"元","十","百","千","万","十万","百万","千万","亿"};
char *d[]={"角","分"};
char c[15];
int i=0,k=0,j,s,x;
char g;
gets(c);
while (c[i]!='\0')
{i++;
if (c[i]=='.')
printf("%s%s",a[atoi(&g)-1],b[i-1]);
i--;}
for(j=0;j<s-k;j++)
{x=j;
g=c[k+1+j];
if(atoi(&g)!=0)
printf("%s%s",a[atoi(&g)-1],d[x]);
x++;}
}
}
{
j=s/pow(10,q);
g=(int)j%10;
if(g!=0)
printf("%s%s",a[g-1],d[-q-1]);}
}
第二种:
#include "stdio.h"
#include "stdlib.h"
void main()
{char *a[]={"壹","贰","叁","肆","伍","陆","柒","捌","玖"};
k=i;
}
s=i;
if (k==0)
for(j=0;j<i;j++)
{g=c[j];
if (atoi(&g)!=0)
printf("%s%s",a[atoi(&g)-1],b[s-1]);
s--;}
else
{ i=k;
for(j=0;j<=k;j++)
{g=c[j];
if (atoi(&g)!=0)
char *d[]={"角","分"};
scanf("%f",&s);
s=s+0.003;
for(百度文库=8;i>0;i--)
{j=s/pow(10,i);
if(j!=0)
break;
}
for(q=i-1;q>=0;q--)
{j=s/pow(10,q);
g=(int)j%10;
if(g!=0)
printf("%s%s",a[g-1],b[q]);}
第一种:
#include "stdio.h"
#include "math.h"
void main()
{
float s,j;
int i,q,g;
char *a[]={"壹","贰","叁","肆","伍","陆","柒","捌","玖"};
char *b[]={"元","十","百","千","万","十万","百万","千万","亿"};
char *b[]={"元","十","百","千","万","十万","百万","千万","亿"};
char *d[]={"角","分"};
char c[15];
int i=0,k=0,j,s,x;
char g;
gets(c);
while (c[i]!='\0')
{i++;
if (c[i]=='.')
printf("%s%s",a[atoi(&g)-1],b[i-1]);
i--;}
for(j=0;j<s-k;j++)
{x=j;
g=c[k+1+j];
if(atoi(&g)!=0)
printf("%s%s",a[atoi(&g)-1],d[x]);
x++;}
}
}