标签:rgs system div list bsp for void style lse
1 public class Main{ 2 public static int list[]= {1,2,3}; 3 public static void swap(int list[],int k,int m){ 4 int temp=list[k]; 5 list[k]=list[m]; 6 list[m]=temp; 7 } 8 public static void perm(int list[],int k,int m) { 9 if(k==m) { 10 for(int i=0;i<=m;i++) { 11 System.out.print(list[i]); 12 } 13 System.out.println(); 14 } 15 else { 16 for(int i=k;i<=m;i++) { 17 swap(list,k,i); 18 perm(list,k+1,m); 19 swap(list,k,i); 20 } 21 } 22 } 23 public static void main(String args[]) { 24 perm(list,0,2); 25 } 26 }
标签:rgs system div list bsp for void style lse
原文地址:https://www.cnblogs.com/DixinFan/p/10204835.html