九度教程第91题
C语言源码:[cpp]#include<stdio.h>#include<string.h>char s[10],a[10];int mark[10];int d(int i,int n){int j;if(i==n){a[n]='\0';printf("%s\n",a);/*这道题要是这么写就超时for(j=0;j<n;j++)printf("%c",a[j]);printf("\n");*/}else{for(j=0;j<n;j++){if(mark[j]==-1){a[i]=s[j];mark[j]=1;d(i+1,n);mark[j]=-1;}}}}int main(){ www.zzzyk.comint len,i;while(scanf("%s",s)!=EOF){len=(int)strlen(s);for(i=0;i<len;i++)mark[i]=-1;d(0,len);printf("\n");}}
补充:软件开发 , C++ ,