#include using namespace std; class Point { float x,y; public : Point(float a=0, float b=0) { x=a; y=b; cout << "contructeur 1 : "<< x <<","<< y <<"\n"; } Point(Point & p){ x=p.x; y=p.y; cout << "contructeur 2 : "<< x <<","<< y <<"\n"; } ~Point(){ cout << "destructeur : "<< x <<","<< y <<"\n"; } float getX() { return x; } float getY() { return y; } void setX(float z){ x=z; } void setY(float z){ y=z; } // Déplace le point à droite horizontalement d'une distance d void deplacerADroite(float d) throw (float) { if (d>=0) { x=x+d; } else { throw (d); // si d<0 il ne s'agit pas d'un déplacement à droite ! } } void afficher(){ cout << "(" <b.y){ return " le second est plus bas \n"; } else { return " les deux sont à la même hauteur \n"; } }