vc模拟银行常用打印程序,哪错了?
#include<stdio.h>int main()
{
char Number[128];
char Interger[64],Decimal[64];
int lenI,lenD;
int i,j;
void PrintInterger(char a[],int len);
void PrintDecimal(char a[],int len);
puts("********************************\n");
puts("* this is a print program *\n");
puts("* used in a bank *\n");
puts("********************************\n");
puts("please input the money:");
gets(Number);
i=0;j=0;
while((Number[i]!='\0')&&(Number[i]!='.'))
{
Interger[i]=Number[i];
i++;
}
lenI=i;
PrintInterger(Interger,lenI);
if(Number[i]=='.')
{
i++;
while(Number[i]!='\0')
Decimal[j++]=Number[i++];
if((j>=4)&&(Decimal[4]>='5'))
{
Decimal[3]+=1;
Decimal[4]='\0';
}
if(j>=4)
lenD=4;
else
lenD=j;
PrintDecimal(Decimal,lenD);
}
getchar();
return 0;
}
void PrintInterger(char a[],int len)
{
int i,j;
printf("你的钱数是: \n");
for(i=0,j=len-1;(a[i]!='.')&&(a[i]!='\0');i++,j--)
{
switch(a[i])
{
case'0':
{
do
{
i++;
j--;
}while(a[i]!=0);
printf("%s","零");
break;
}
case'1':
printf("%s","壹");break;
case'2':
printf("%s","贰");break;
case'3':
printf("%s","叁");break;
case'4':
printf("%s","肆");break;
case'5':
printf("%s","伍");break;
case'6':
printf("%s","陆");break;
case'7':
printf("%s","柒");break;
case'8':
printf("%s","捌");break;
case'9':
printf("%s","玖");break;
default:
printf("error");break;
}
switch(j)
{
case'1':
printf("%s","个");break;
case'2':
printf("%s","十");break;
case'3':
printf("%s","百");break;
case'4':
printf("%s","千");break;
case'5':
printf("%s","万");break;
case'6':
printf("%s","十万");break;
case'7':
printf("%s","百万");break;
case'8':
printf("%s","千万");break;
case'9':
printf("%s","忆");break;
default:
printf("%s",' ');break;
}
}
}
void PrintDecimal(char a[],int len)
{
int i;
for(i=0;i<=len;i++)
{
switch(a[i])
{
case'0':
printf("%s","零");break;
case'1':
printf("%s","壹");break;
case'2':
printf("%s","贰");break;
case'3':
printf("%s","叁");break;
case'4':
printf("%s","肆");break;
case'5':
printf("%s","伍");break;
case'6':
printf("%s","陆");break;
case'7':
printf("%s","柒");break;
case'8':
printf("%s","捌");break;
case'9':
printf("%s","玖");break;
default:
printf("error");break;
}
switch(a[i])
{
case'0':
printf("%s","零");break;
case'1':
printf("%s","壹");break;
case'2':
printf("%s","贰");break;
case'3':
printf("%s","叁");break;
case'4':
printf("%s","肆");break;
}
}
}
哪错了,求大神指教