#include<stdio.h>
#include<iostream>
#include<wchar.h>
#include<cstdlib>
#include<iomanip>
#include<string.h>
using namespace std;
class point
{
private:
int x,y;
public:
void setpoint(int a,int b)
{
x=a;
y=b;
}
int getx()
{
return x;
}
int gety()
{
return y;
}
};
int main()
{
point p1,p2;
int i,j;
p1.setpoint (1,2);
p2.setpoint (3,4);
i=p1.getx ();
j=p1.gety ();
cout << "p1 i=" << i << "p1 j="<< j <<endl;
i=p2.getx ();
j=p2.gety ();
cout << "p2 i=" << i << "p2 j="<< j <<endl;
}
#include<iostream>
#include<wchar.h>
#include<cstdlib>
#include<iomanip>
#include<string.h>
using namespace std;
class point
{
private:
int x,y;
public:
void setpoint(int a,int b)
{
x=a;
y=b;
}
int getx()
{
return x;
}
int gety()
{
return y;
}
};
int main()
{
point p1,p2;
int i,j;
p1.setpoint (1,2);
p2.setpoint (3,4);
i=p1.getx ();
j=p1.gety ();
cout << "p1 i=" << i << "p1 j="<< j <<endl;
i=p2.getx ();
j=p2.gety ();
cout << "p2 i=" << i << "p2 j="<< j <<endl;
}