Загрузка данных


#include <iostream>
using namespace std;

class MyInt {
public: 
    int i;
    MyInt(int a) {  i = a;  }
    MyInt() {  i = 0;   }
    MyInt(MyInt& mi) {
        i = mi.i;    }
    MyInt& operator=(const MyInt& other) {
        i = other.i;    return*this;    }   
    MyInt operator-(const MyInt& other) {
        MyInt result;
        result.i = i - other.i;
        return result;    }
    MyInt operator*(const MyInt& other) {
        MyInt result;
        result.i = i * other.i;
        return result;    }
};
MyInt operator+(const MyInt& me, const MyInt& other) {
    MyInt result;
    result.i = me.i + other.i;
    return result;
}
ostream& operator<< (ostream& strm, MyInt& mli) 
{    return strm << mli.i;  }
int main(){
    MyInt a(5);
    MyInt b(12);
    MyInt c(3);
    MyInt d= c;
    d = a + b; 
    MyInt tmp1; tmp1.operator=(operator+(a, b)); 
    d = tmp1; 
    d.operator=(tmp1);
    cout << d << endl;
    /*std::cout << b << endl;
    std::cout << c << endl;*/
}