• 个人简介
  • 通过的题目
  • 最近活动
  • 最近编写的题解

#include<bits/stdc++.h> using namespace std; int a[10]; int book[10]; void dfs(int step){ if(step==4){ for(int i=1;i<=3;i++) cout<<a[i]<<" "; cout<<endl; return; } for(int i=1;i<=3;i++){ if(book[i]==0){ a[step]=i; book[i]=1; dfs(step+1); book[i]=0; } } } int main(){ dfs(1); return 0; }

This person is lazy and didn't write any solutions.

题目标签

分支问题
11
基础问题
10
简单循环
5
需要找规律的循环
3
字符串
1
搜索
1
深搜
1
回溯
1
循环语句
1
递归
1
一维数组
1