自考新教材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