#include class licznik { public: licznik() { set(0); } licznik(int a) { set(a); } ~licznik(); friend ostream &operator<<(ostream &lewy , licznik &prawy) { lewy << prawy.get() ; return lewy; } friend istream &operator>>(istream &wejscie, licznik &cos) { wejscie >> cos.liczba; return wejscie; } licznik &operator=(licznik &prawy) { set(prawy.get()); return *this; } licznik &operator=(int prawy) { set(prawy); return *this; } licznik &operator!() //inaczej reset { set(0); return *this; } licznik & operator++() { set(get()+1); return *this; } licznik &operator--() { set(get()-1); return *this; } licznik &operator-=(int prawy) { set(get()-prawy); return *this; } licznik &operator+=(int prawy) { set(get()+prawy); return *this; } licznik &operator+=(licznik &prawy) { set(get()+prawy.get()); return *this; } licznik &operator-=(licznik &prawy) { set(get()-prawy.get()); return *this; } void set(int a) // ustawia wartośc { liczba=a; } int get() // pobiera wartosc { return liczba; } void print() { cout << liczba << endl; } private: int liczba; };