#include #include class Account { long long cents_ = 0; public: bool deposit(long long amount) { if (amount <= 0 || amount > std::numeric_limits::max() - cents_) return false; cents_ += amount; return true; } bool withdraw(long long amount) { if (amount <= 0 || amount > cents_) return false; cents_ -= amount; return true; } long long balance() const { return cents_; } }; int main() { Account a; a.deposit(1000); std::cout << a.withdraw(1200) << " " << a.balance() << "\n"; }