标签:style class blog code color string
package reverseList; public class Main { static void perm(char c[],int lev,char ans[]) { if(c.length==lev) { System.out.println(String.valueOf(ans)); } else { for(int i=0;i<c.length;i++) { ans[lev]=c[i]; perm(c,lev+1,ans); } } } public static void main(String[] args) { // TODO Auto-generated method stub char c[]="ab".toCharArray(); char ans[]=new char[3]; perm(c,0,ans); } }
ab的排列 aa , ab ba,bb,布布扣,bubuko.com
标签:style class blog code color string
原文地址:http://www.cnblogs.com/hansongjiang/p/3786432.html