单选题

下列程序的输出结果是1 0 3 ,请将横线处缺失程序补充完整() #inc...

发布于 2022-03-03 16:12:10

下列程序的输出结果是1 0 3 ,请将横线处缺失程序补充完整()
#include<iostream>
using namespace std
class   A
{
public:
    A(int a)
    {
    x=a
     }
    void set() 
     {
    x-=5
    y+=5
     }
    void show()
    {
  cout<<x<<" "<<y<<" "
    }
private:
        int x
        static int y
}
int A::y=0
class B:public A
{
public:
       B(int a,int b ,int c):A(a),_______ z(c)
               {}
       void set()
       {
      A::set()
       z+=2
       }
       void show()
       {
     A::show()
     cout<<z<<endl
       }
private:
        int z
}
int main()
{
B  b(1,2,3)
b.show()
return 0
}


登录后免费查看答案
关注者
0
被浏览
27
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看