Здравствуйте. Помогите пожалуйста с программой на С++, задание - перегрузить операторы +=, *=, = для длинных чисел. Сделал все кроме *= немогу написать норм. алгоритм. main.cpp PHP: #include "Hugeint.h" int main() { long numb1, numb2, numb3; cout << "Please enter number 20 < diggits. ok? " << endl; cout << "Enter first number ( Huge INT ): "; cin >> numb1; cout << "Enter second number ( Huge INT ): "; cin >> numb2; cout << "Enter one number ( INT ): "; cin >> numb3; cout << endl; HugeInt n1( numb1 ); HugeInt n2( numb2 ); HugeInt n5; cout << "First (HugeInt) is: " << n1 << "\nSecond (HugeInt) is: " << n2 << "\nEmpty (HugeInt) is: " << n5 << "\nOne (Int) is: " << numb3 << "\n" << endl; n5 = n1 + n2; cout << "(HugeInt) + (HugeInt): " << endl; cout << n1 << " + " << n2 << " = " << n5 << "\n\n"; n5 = n1 + numb3; cout << "(HugeInt) + (INT): " << endl; cout << n1 << " + " << numb3 << " = " << n5 << "\n\n"; cout << "(HugeInt) += (HugeInt): " << endl; cout << n1 << " += " << n2 << " = "; n1 += n2; cout << n1 << "\n"; cout << "(HugeInt) *= (HugeInt): " << endl; cout << n1 << " *= " << n2 << " = "; n1 *= n2; cout << n1 << "\n"; cout << endl; return 0; } HugeInt.h PHP: #include <iostream> using namespace std; class HugeInt { friend ostream &operator<<( ostream &, const HugeInt & ); public: HugeInt( long = 0 ); HugeInt( const char * ); HugeInt operator+( const HugeInt & ) const; HugeInt operator+( int ) const; HugeInt operator+=( HugeInt & ); HugeInt operator=( HugeInt & ); HugeInt operator*=( HugeInt & ); private: short integer[ 90 ]; }; HugeInt.cpp PHP: #include "Hugeint.h" HugeInt::HugeInt( long value ) { for ( int i = 0; i <= 29; i++ ) integer[ i ] = 0; for ( int j = 29; value != 0 && j >= 0; j-- ) { integer[ j ] = value % 10; value /= 10; } } HugeInt HugeInt::operator+( const HugeInt &op2 ) const { HugeInt temp; int carry = 0; for ( int i = 29; i >= 0; i-- ) { temp.integer[ i ] = integer[ i ] + op2.integer[ i ] + carry; if ( temp.integer[ i ] > 9 ) { temp.integer[ i ] %= 10; carry = 1; } // end if else carry = 0; } return temp; } HugeInt HugeInt::operator+( int op2 ) const { return *this + HugeInt( op2 ); } HugeInt HugeInt::operator+=( HugeInt & op2) { HugeInt temp; int carry = 0; for ( int i = 29; i >= 0; i-- ) { integer[ i ] = integer[ i ] + op2.integer[ i ] + carry; if ( integer[ i ] > 9 ) { integer[ i ] %= 10; carry = 1; } // end if else carry = 0; } return *this; } HugeInt HugeInt::operator=( HugeInt & op2) { if ( this == &op2) ; else for ( int i = 29; i >= 0; i-- ) { integer[ i ] = op2.integer[ i ]; } return *this; } HugeInt HugeInt::operator*=( HugeInt & op2) { int carry, i, j, x = 0; HugeInt temp; for (i = 29; i >= 0; --i) { int p=0; for (j = 29; j >= 0; --j) { x= integer[ i ]* op2.integer[ i ] + p + temp.integer[ i+j ]; temp.integer[ i+j ]=x%10; p=x/10; } temp.integer[i+j+1]=p; } return temp; } ostream& operator<<( ostream &output, const HugeInt &num ) { int i; for ( i = 0; ( num.integer[ i ] == 0 ) && ( i <= 29 ); i++ ) ; if ( i == 30 ) output << 0; else for ( ; i <= 29; i++ ) output << num.integer[ i ]; return output; } В чем ошибка в операторе *= ?