若下面程序运行时输出结果为
1, A, 10.1
2, B, 3.5
请将程序补充完整 。
#include
using namespace std;
int main()
{
void test(int, char,double 【 8 】 );
test(1,'A',10.1);
test(2,'B');
return 0;
}
void test(int a, char b, double
C .
{
cout<
}
第1题:
下列程序的输出结果为2,请将程序补充完整。
include<iostream>
using namespace std;
class Basc
{
public:
【 】void fun(){cout<<1;}
};
class Dcrived:public Base
{
public:
void fun(){cout<<2;}
};
int main()
{
Base*p=new Derived;
p->fun();
delete p;
return 0;
}
第2题:
下列程序的输出结果为2,请将程序补充完整。
include<iostream>
using namespace std;
class Base
{
public:
______void fun(){cout<<1;}
};
class Derived:public Base
{
public:
void fun(){cout<<2;}
};
int main()
{
Base*p=new Derived;
p->fur();
delete p;
return 0;
}
第3题:
下列程序的输出结果为2,请将程序补充完整。
include <iostream>
using namespaee std;
class Base{
public:
______void fun( ){cout<<1;}
};
class Derived:public Base{
public:
void fun( ){cout<<2;}
};
int main( ){
Base*P=new Derived:
p->fun( );
delete P;
return 0;
}
第4题:
请将如下程序补充完整,使得输出结果为:bbaa
include <iostream>
using namespace std;
class A {
public:
【 】{cout << "aa"; }
};
class B: public A{
public:
~B(){ cout << "bb"; }
};
int main () {
B *p= new B;
delete p;
return 0;
}
第5题:
若下列程序运行时输出结果为
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;
}