Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CInt55 {
- private:
- int liczba;
- public:
- CInt55(int parametr=0) {
- liczba = parametr%55;
- }
- void operator=(int liczba) {
- this->liczba = liczba%55;
- }
- void rownasie(int liczba) {
- this->liczba = liczba%55;
- }
- CInt55& operator*(CInt55 c) {
- CInt55 temp(this->liczba * c.liczba);
- return temp;
- }
- friend void operator=(CInt55, int);
- friend void operator<<(ostream&, CInt55&);
- friend ostream& operator<<(ostream&, CInt55&);
- };
- void operator=(CInt55 a, int b) {
- a.liczba = b%55;
- }
- void operator<<(ostream &wyjscie, CInt55 &d) {
- wyjscie << d.liczba;
- }
- ostream& operator<<(ostream &wyjscie, const CInt55 &d) {
- return wyjscie << d.liczba;
- }
- int main() {
- CInt55 a(0);
- CInt55 b(60);
- CInt55 c;
- c = a*b;
- cout << c;
- return 0;
- }
Add Comment
Please, Sign In to add comment