C++实现数字重排:最小数判断 - 代码示例与解析 日期: 2026-03-21 标签: 常规 #include \n#include \n#include \n\nusing namespace std;\n\nint main() {\n int n, m;\n cin >> n >> m;\n \n string n_str = to_string(n);\n sort(n_str.begin(), n_str.end());\n int smallest_num = stoi(n_str);\n \n if (smallest_num == m) {\n cout << "OK" << endl;\n } else {\n cout << "WRONG_ANSWER" << endl;\n }\n \n return 0;\n} 原文地址: https://www.cveoy.top/t/topic/pRDB 著作权归作者所有。请勿转载和采集! 免费AI点我,无需注册和登录