题目内容:
字符串str由数字字符组成(长度不超过5个字符),可看作任意进制的数,请补充函数proc(),该函数的功能是:把str字符串从二进制转换成十进制的数,结果保存在数组xx中,由函数返回转换后数组xx的实际长度。其中x表示str原来的进制,y表示要转换成的进制。例如,输入str=″1011″,x=2,y=l0,结果输出11。 注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:



参考答案:
答案解析: