#include<stdio.h>
char data[5]={'a','b','c','d','e'};
int vist[5]={0};
char step[5]={0};
char bu[5];
void quan(int i)
{
 if(i==5)
 {
  for(int a=0;a<5;a++)
   printf("%c",step[a]);
  printf("\n");
  return;
 }
 for(int a=0;a<5;a++)
 {
  if(vist[a]==0)
  {
   vist[a]=1;
   step[i]=data[a];
   quan(i+1);
   vist[a]=0;
  }
 }
}
void bian(int i)
{
 if(i==5)
 {
  for(int a=0;a<5;a++)
   printf("%c",bu[a]);
  printf("\n");
  return;
 }
 for(int a=0;a<5;a++)
 {
  bu[i]=data[a];
  bian(i+1);
 }
}
int main()
{
 quan(0);
 printf("-----------");
 //bian(0);
 return 0;
}

quanpailie quanbianli的更多相关文章

  1. n0_n1

    #include<stdio.h>int a[10];void quanpailie(int i){ if(i==10)  {for(i=0;i<10;i++)  {   print ...

  2. 全排列Permutations

    描述 Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the foll ...

随机推荐

  1. 对于JavaScript的函数.NET开发人员应该知道的11件事

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 昨天小感冒今天重感冒,也不能长篇大论.如果你是.NET开发人员,在进入前端开发领域的时候,对 ...

  2. Codeforces Round #313 (Div. 2)B.B. Gerald is into Art

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/ ...

  3. loj 1046(bfs)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=26766 思路:由于数据不是很大,我们可以枚举骑士最后聚集的位置,然 ...

  4. 解决treeview未选中时,默认选中首个根节点的问题!

    private void treeView1_MouseUp(object sender, MouseEventArgs e) { TreeNode selectnode = this.treeVie ...

  5. 【Log4j2 配置详解】log4j2的资源文件具体怎么配置

    可以先附上一个log4j2的资源文件详细内容,对照着看 ### set log levels ### log4j.rootLogger = INFO , C , D , E ### console # ...

  6. SpringBoot相关

    快速构建项目 第 1 步:将这个 Spring Boot 项目的打包方式设置为 war. <packaging>war</packaging> SpringBoot 默认有内嵌 ...

  7. http://jingyan.baidu.com/article/d169e186aa8728436611d8f3.html

    http://jingyan.baidu.com/article/d169e186aa8728436611d8f3.html

  8. LightOJ1057 Collecting Gold(状压DP)

    这道题可以想到几点: 整个行程可以看作一次次的行走,每次行走都是用最短的路程从某一非空点到达另外一非空点: 两点间最少的步数是二者x和y坐标差的最大值: 返回原点这个过程,肯定是取完最后一个黄金后直接 ...

  9. OI再见

    以下是一只蒟蒻的回忆: 1.进入高一 小县城不重视OI,直到进了高中才知道有OI这个东西,于是我就开始了OI…(看,够弱的吧,相信你是小学就开始学了) 学了几天Pascal语法后,被老师报上了NOIP ...

  10. UITapGestureRecognizer 和 CCMenu点击问题

    当一个scene中同时有UITapGestureRecognizer和CCMenu,点击时不会响应CCMenu,此时必须对UITapGestureRecognizer进行设置 UITapGesture ...