public class Subset {
public static void main(String[] args) {
set("","abc");
}
public static void set(String left, String right) {
if(right == null || right.equals("")) {
System.out.println(left);
return;
}
//选
set(left+right.substring(0,1),right.substring(1));
//不选
set(left,right.substring(1));
}
}
网友评论