64,691
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
class Vector2D
{
public:
int x1,x2,y1,y2;
void input1()
{
cout<<"Please input the x1 of the A(x1,x2) "<<endl;
cin>>x1;
cout<<"Please input the x2 of the A(x1,x2) "<<endl;
cin>>x2;
}
void input2()
{
cout<<"Please input the y1 of the B(y1,y2) "<<endl;
cin>>y1;
cout<<"Please input the y2 of the B(y1,y2) "<<endl;
cin>>y2;
}
int Multiply()//<---------here
{
return x1*x2+y1*y2;
}
};
int main()
{ Vector2D v;
v.input1();
v.input2();
cout<<v.Multiply()<<endl;//<--------------here
}