#include <iostream>
using namespace std;
void test(int x[])
{
if (10 == x[0] + x[1] + x[2] + x[3])
{
cout << x[0] << x[1] << x[2] << x[3] << endl;
}
}
void dfs(int x[], int cur)
{
if (4 == cur)
{
test(x);
return;
}
for (int i = 1; i < 4; i++)
{
x[cur] = i;
dfs(x, cur + 1);
}
}
int main()
{
int x[4] = {0};
dfs(x, 0);
return 0;
}或者就是暴力 for循环
递归求 a+b+c+d == 10, a、b、c、d 都大于0小于5
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Llama Factory
模型微调
LLama-Factory
LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调

被折叠的 条评论
为什么被折叠?



