Другие языки программирования и технологии

помогите пожалуста решить задачу на СИ++..

Разработайте программу, в которой реализована перегрузка оператора «>». Оператор «>» должен увеличивать число на то количество единиц, которое укажет пользователь.
#include <iostream>

using namespace std;

class Bydlocoder {
public:
    Bydlocoder() { };
    Bydlocoder(int _n) : n(_n) { }
    operator int() const { return n; }
    friend Bydlocoder & operator>(Bydlocoder &, const int);
    friend ostream & operator<<(ostream &, const Bydlocoder &);
    friend istream & operator>>(istream &, Bydlocoder &);
    Bydlocoder & operator=(const int);
private:
    int n;
};
typedef Bydlocoder INT;

int main() {
    locale::global(locale(""));

    INT x = 5;
    cout << " До: " << x << endl;
    x = x > 5;
    cout << " После: " << x << endl;
    
    cout << " Введите целое число: ";
    INT y;
    cin >> y;
    cout << " Вы ввели: ";
    cout << y << endl;
    cout << " Введите целое число, чтобы прибавить его к ранее введённому: ";
    int k;
    cin >> k;
    y = y > k;
    cout << " Сумма = " << y << endl;

cin.get(); cin.get();
return 0;
}

Bydlocoder & operator>(Bydlocoder & _int, const int _dx) {
    _int.n += _dx;
    return _int;
}

Bydlocoder & Bydlocoder::operator=(const int _n) {
    this->n += _n;
    return *this;
}

ostream & operator<<(ostream & _cout, const Bydlocoder & _int) {
    _cout << _int.n;
    return _cout;
}

istream & operator>>(istream & _cin, Bydlocoder & _int) {
    _cin >> _int.n;
    return _cin;
}

А это мои пять копеек во вклад современного образования!
СИ
Санёк Исаев
97 170
Лучший ответ
Вот так быдлокодеров и растят.. . Перегрузка не должна менять поведение операторов! Может, но не должна! Код будет совершенно нечитаемым.. .
Artem Barsegyan
Artem Barsegyan
88 166
#include <cmath>
#include <iostream>

class num {
    int v;
public:
    num(): v(0) {}
    int operator()() { return v; }
    friend num& operator>(num &v, int n) { v.v += n; return v; }
};

int main() {
    num n;
    std::cout << n() << std::endl;
    n > 5;
    std::cout << n() << std::endl;
}

ЗЫ:
> Оператор «>» должен увеличивать число.. .
Кэп все верно сказал. Это неправильно. Преподу передай привет от "ответов" и процитируй ответ Кэпа.