void cal() { int num3, num2; int index = -1; for (int i = 0; i < 5; ++i) for (int j = 0; j < 5; ++j) for (int k = 0; k < 5; ++k) for (int l = 0; l < 5; ++l) for (int m = 0; m < 5; ++m) if (i != j && i != k && i != l && i != m && j != k && j != l && j != m && k != l && k != m && l != m) { num3 = num[i] * 100 + num[j] * 10 + num[k]; num2 = num[l] * 10 + num[m]; if (num2 >= 10 && num3 >= 100) datas[++index] = num3 * num2; else datas[++index] = 99999; } sort(&datas[0], &datas[120]); cout << datas[0]; }