# 继承改错题。两行星号线之间的程序中有几处错误，请改正，得到输出结果，提交星号线之间的程序即可。

***********************************
#include <iostream>
using namespace std;
class A
{
private:
int a,b;
public:
A(int aa, int bb) {a=aa; b=bb;}
void printA()
{
cout<<"a: "<<a<<" b: "<<b<<endl;
}
}
class B: public A
{
int c;
public:
B(int aa, int bb, int cc){a=aa;b=bb;c=cc;}
void printB()
{
cout<<"a: "<<a<<" b: "<<b<<"c: "<<c<<endl;
}
};
//*****************************************
int main()
{
int a1, a2;
int b1, b2, b3;
cin>>a1>>a2;
cin>>b1>>b2>>b3;
A a(a1,a2);
B b(b1,b2,b3);
a=b;
a.printA();
b.printB();
return 0;
}

``1 2 3 4 5``

``````a: 3 b: 4
a: 3 b: 4
c: 5``````

``````#include <iostream>
using namespace std;
class A
{
private:
int a,b;
public:
A(int aa, int bb) {a=aa; b=bb;}
void printA()
{
cout<<"a: "<<a<<" b: "<<b<<endl;
}
};
class B: public A
{
int c;
public:
B(int aa, int bb, int cc):A(aa,bb){c=cc;}
void printB()
{   printA();
cout<<"c: "<<c<<endl;
}
};
int main()
{
int a1, a2;
int b1, b2, b3;
cin>>a1>>a2;
cin>>b1>>b2>>b3;
A a(a1,a2);
B b(b1,b2,b3);
a=b;
a.printA();
b.printB();
return 0;
}``````

``````#include <iostream>
using namespace std;
class A
{
private:
int a,b;
public:
A(int aa, int bb) {a=aa; b=bb;}
void printA()
{
cout<<"a: "<<a<<" b: "<<b<<endl;
}
};
class B: public A
{
int c;
public:
B(int aa, int bb, int cc):A(aa,bb){c=cc;}
void printB()
{   printA();
cout<<"c: "<<c<<endl;
}
};
int main()
{
int a1, a2;
int b1, b2, b3;
cin>>a1>>a2;
cin>>b1>>b2>>b3;
A a(a1,a2);
B b(b1,b2,b3);
a=b;
a.printA();
b.printB();
return 0;
}``````