diff --git a/seminar02_encapsulation/1number/number.cpp b/seminar02_encapsulation/1number/number.cpp index 1950874..666e55f 100644 --- a/seminar02_encapsulation/1number/number.cpp +++ b/seminar02_encapsulation/1number/number.cpp @@ -151,6 +151,8 @@ Number Number::operator*(const Number & right) const size << ")" << " " << "arg2=" << right << "(capacity=" << right. capacity << ",size=" << right.size << ")" << std::endl; #endif + if (*this == Number("0") || right == Number("0")) + return Number("0"); int i, j; int temp; Number result;