摘要: #include<iostream>using namespace std;//非递归求解所有的子集void fun(int a[] , int n){ int i = 0 , j ; while(i < (1<<n)) //2的n次方 { for(j = 0 ; j < n ; j ++) { if(i&(1<<j)) { cout<<a[j]<<"\t"; } } cout<<endl; i++; }}//递归求解所有的子集void print(int a[],bool flag 阅读全文
posted @ 2011-05-09 09:18 糖拌咸鱼 阅读(563) 评论(0) 推荐(0) 编辑