Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- using namespace std;
- class point {
- int x,y;
- public: point(){
- x=0;
- y=0;
- }
- ///////////////
- int getx()
- {
- return x;
- }
- //////////////////
- int gety()
- {
- return y;
- }
- ////////////////////////
- void setx(int s)
- {
- x=s;
- }
- //////////////////
- void sety(int s)
- {
- y=s;
- }
- ////////////////////
- void deplacer(int a,int b)
- {
- x=x+a;
- y=y+b;
- }
- ////////////////////
- void afficher()
- {printf("les coord du pt est :%d,%d",x,y);
- }
- /////////////
- };
- main()
- {point z;
- z.setx(2);
- z.sety(3);
- z.afficher();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement