以下是使用 C++语言解决此问题的代码: ```cpp #include <iostream> int main() { int num1, num2, max, min; std::cout << "请输入两个整数,用空格分隔: "; std::cin >> num1 >> num2; if (num1 == num2) { std::cout << "the two numbers are equal." << std::endl; } else { if (num1 > num2) { max = num1; min = num2; } else { max = num2; min = num1; } std::cout << "the larger number is " << max << ", the smaller number is " << min << "." << std::endl; } return 0; } ``` [2024-10-10 23:00:17 | AI写代码神器 | 191点数解答]