自考新教材p141-4
作者:互联网
#include <iostream>
using namespace std;
class A
{
private:
int a, b;
public:
A(int aa, int bb)
{
a = aa--;
b = a*bb;
}
void show()
{
cout << "a=" << a << ", b=" << b << endl;
}
};
int main()
{
A x(4, 5);
x.show();
return 1;
}
结果:4 和 20
标签:aa,std,bb,show,新教材,p141,int,自考 来源: https://www.cnblogs.com/duanqibo/p/15614412.html