有人看看我的代码吗?
查看原帖
有人看看我的代码吗?
1269423
huge_wave楼主2024/6/13 14:04
#include<bits/stdc++.h>
using namespace std;
const int N=100;
typedef long long ll;
int n,m;
int da[N];
bool a[N]; 
void dfs(int x,int cnt){
	if(cnt>3){
		for(int i=1;i<=3;i++){
			printf("%d ",da[i]);
		}
		printf("\n");
		return;
	}
	if(x>5){
		return;
	}
	a[x]=true;
	da[cnt]=x;
	dfs(x+1,cnt+1);
	a[x]=false;
	da[cnt]=0;
	dfs(x+1,cnt);
}
int main(){
	/*ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);*/
	scanf("%d%d",&n,&m);
	dfs(1,1);
	
	return 0;
}

2024/6/13 14:04
加载中...