为什么有错误啊,,,求解啊
#include<stdio.h>#include<string.h>
void main()
{
int i,n,sw=0;
void jiaofen(char tmp[]);
void yuan(char tmp[]);
char money[20],y[10],jf[10];
printf("输入人名币金额:");
gets(money);
while(i<=n&&money[i]!='.')i++;
money[i]='\0';
strcpy(y,money);
strcpy(jf,&money[i+1]);
if(n>10||strlen(jf)>2)
{
printf("输入的数据有误:");
return;
}
printf("\n");
yuan(y);
jiaofen(jf);
printf("\n");
}
void yuan(char tmp[])
{
char wei[][3]={"角","分"};
char suhz[][3]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
int i,n;
n=strlen(tmp);
for(i=0;i<n;i++)
{
printf("%s",suhz[tmp[i]-'\0']);
printf("%s",wei[n-i-i]);
}
}
void jiaofen(char tmp[])
{
char wei[][3]={"角","分"};
char suhz[][3]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
int i,n;
n=strlen(tmp);
for(i=0;i<n;i++)
{
printf("%s",suhz[tmp[i]-'\0']);
printf("%s",wei[n-i-i]);
}
printf("元");
}