This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#include <bits/stdc++.h>
using namespace std;
int n = 9;
const int INF = 0x3f3f3f3f;
int res = INF, a1, b1, c1;
int main() {
int a, b, c;
for (a = 1; a <= n; a++)
for (b = a; b <= n; b++)
for (c = b; c <= n; c++) {
if (n == a * b * c) {
if (b - a + c - b + c - a < res) {
res = b - a + c - b + c - a;
a1 = a, b1 = b, c1 = c;
}
}
}
cout << "a=" << a1 << ",b=" << b1 << ",c=" << c1 << endl;
return 0;
}