若下面程序运行时输出结果为:
1,A,10.1
2,B,3.5
请将程序补充完整。
#include<iostream>
using namespace std;
int main()
void test(int, char,double______);
test(1, ’A’, 10.1);
test(2, ’B’);
return 0;
void test(int a, char b, double c)
cout<<a<<’,’<<b<<’,’<<c<<end1;
参考答案:=3.5
解析: 本题考查了函数默认参数的应用。本题中第一次调用test()函数数值1,A,10.1;第二次调用少了一个实参,却要求输出2,B,3.5,南此分析,应将test()函数的第三个参数声明为默认参数。且默认为3.5,才能达到要求的输出结果。故应填入=3.5或者c=3.5。