#include <bits> using namespace std; int res = 0, target = 0, sum = 0; void backtracking(vector<int>& nums) { if (sum >= target) return; res = max(res, sum); for (int i = 0; i < nums.size(); i++) { int t = sum; sum = 10 * sum + nums[i]; backtracking(nums); sum = t; // backtrack } } int main() { vector<int> nums = {2,3,5}; target = 53222355; backtracking(nums); cout << res << endl; return 0; } 这是和朋友讨论一些结果</int></int></bits>