Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class kursor
- {
- int x,y;
- public:
- void ustal()
- {
- int a,b;
- cout<<"podaj wspolzedne x"<<endl;
- cin>>a;
- cout<<"podaj wspolzedne y"<<endl;
- cin>>b;
- if((a<80)&& (b<25))
- {
- this->x=a;
- this->y=b;
- }
- else
- {
- cout<<"podales bledne wspolzedne"<<endl;
- this->x=0;
- this->y=0;
- }
- }
- void pokaz()
- {
- cout<<"x="<<x<<endl;
- cout<<"y="<<y<<endl;
- }
- };
- int main()
- {
- // cout << "Hello world!" << endl;
- kursor a,b,c,d;
- a.ustal();
- b.ustal();
- c.ustal();
- d.ustal();
- a.pokaz();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement