C语言中出现cannot convert parameter 1 from 'char [9][3]' to...

发布网友 发布时间:2024-10-24 03:24

我来回答

1个回答

热心网友 时间:2024-11-08 18:38

编译问题是改好了,但是你的程序逻辑有问题,自己找一找吧,
#include <stdio.h>
#include <string.h>
void changeinto(char b[]);
char money[][4]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
char a[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿"};
void main()
{

char b[10];
printf("please input money\n");
gets(b);
changeinto(b);

}
void changeinto(char b[])
{
int i,j=0,n=strlen(b);
for(i=0;i<n;i++)
j=a[i][0]-'0';
printf("%s",a[j]);
}
提示一下:
钱数依次取最高位,将最高位值和money匹配,将最高位的位数和a匹配

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com