1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
using namespace std;
class Point
{
protected:
int taille;
int *dat;
public :
Point(){}
Point(int n)
{
taille = n;
dat =new int[n];
}
int size(){return this->taille;}
inline int & operator []( int i){return this->dat[i];}
friend Point operator +(const Point& ,const Point& );
};
inline Point operator+(const Point& x1,const Point& x2)
{
Point x(x1.size());
for(int i=0;i<x1.size();i++)
{
x[i]= x1[i]+x2[i];
}
return x;
}
int main()
{} |