数据结构算法实现问题
我在实现多项式的求值算法时,不知道主函数怎么写,我是这样写的:
int main()
{
int T;
char *A;
int n;
printf("Could you please input the total number of the formula:\n");
scanf("%d",&n);
A=(int *)malloc(sizeof(int));
printf("Please input the ending_formula by ending with '#':\n");
for(int i=0;i<n;i++)
{
scanf("%c",&A[i]);
}
postfix_exp(*A);
free(A);
return 1;
}
主函数要求:将表达式的各个数值项存入一个大小够大的数组A[MAXSIZE]中,再将其作为postfix_exp函数的形参,调用之实现多项式的求解。
希望大侠帮忙下,小弟感激不尽。。。。
[解决办法]
postfix_exp这个函数呢?