#include <iostream>
using namespace std;
class a
{
public:
a(){"请输入length和high的值:";cin>>length;cin>>high;}
int b(){return length*high;}
private:
int length;
int high;
};
void main()
{
a abc();
cout<<abc.b();
}
为什么在类中不能使用cin给length和high赋值呢?一定要a(i,j){length=i;high=j}吗?