- 月赛
关于xor附件(Bigint warning 修正)
- @ 2026-7-5 11:01:28
operator==中&&与||优先级不规范,导致提交warning,改正如下:
template<class T>bool operator==(T A) {
bigint other(A);
// 重点在这里:给 || 左边的两个 && 条件加上了外层括号 (...)
if ( (other._a == this->_a && other.symbol == this->symbol) ||
(this->size() == 1 && this->symbol == -1 && other.symbol == 1 && other.size() == 1 && (*this)[0] == 0 && other[0] == 0) )
return 1;
return 0;
}