#include<stdio.h>
#include<iostream>
#include<wchar.h>
#include<cstdlib>
#include<iomanip>
using namespace std;
class A
{
private:
int i;
int j;
public:
void point(int a, int b);
int getx();
int gety();
};
void A::point(int a, int b)
{
i=a;
j=b;
}
int A::getx()
{
return i;
}
int A::gety()
{
return j;
}
int main()
{
A p1, p2;
int x,y;
p1.point (1,2);
p2.point (3,4);
x=p1.getx();
y=p1.gety();
cout << x <<‘ ‘<< y<<endl;
x=p2.getx();
y=p2.gety();
cout << x <<‘ ‘<< y<<endl;
return 0;
}
时间: 2024-12-18 12:28:57