#include <iostream> #include <cmath> int main() { int a, b; std::cin >> a >> b; // 计算第三边的取值范围 int lower_bound = std::abs(a - b) + 1; int upper_bound = a + b - 1; // 计算第三边可能的取值数量 int count = upper_bound - lower_bound + 1; std::cout << count << std::endl; return 0; } /************************************************************** Problem: 1525 User: panyuchen Language: C++ Result: Accepted Time:38 ms Memory:2072 kb ****************************************************************/