字集打印0.0
来源:互联网 发布:金融网络销售工作内容 编辑:程序博客网 时间:2024/06/06 09:51
#include<iostream>#include<cstring>using namespace std; const int maxn = 100;int Num[maxn];int tmp[maxn];void Subset_1(int n,int *A,int cur) { ///可以按照排列的类似写法撸出随意集合的字集0.0 for(int i = 0; i < cur; ++i) cout << A[i] << " ";cout << endl;int s = cur ? A[cur-1] +1 : 0;for(int i = s; i < n; ++i) {A[cur] = i;Subset_1(n,A,cur+1);}} void Subset_2(int n,int *B,int cur) {if(cur == n) {for(int i = 0; i < n; ++i) if(B[i]) cout << i << " ";cout << endl;return ;}B[cur] = 1; Subset_2(n,B,cur+1);B[cur] = 0; Subset_2(n,B,cur+1);}void Subset_3(int n) {for(int i = 0; i < (1<<n); ++i) {for(int j = 0; j < n; ++j) if(i & (1<<j)) cout << j << " ";cout << endl; }}int main() {//Subset_1(3,Num,0);//Subset_2(3,Num,0);Subset_3(3);}
0 0
- 字集打印0.0
- 关于ASCII和Unicode字集
- 什么是GB、BIG5、GBK、GB18030字集?
- List集合排序,以及截取字集合
- .基于事件套接字集合的select模型
- 基于事件套接字集合的select 模型
- QT中对数据库的连接字集合
- python 实现识别手写 MNIST数字集的程序
- 如何用卷积神经网络CNN识别手写数字集?
- tensorflow基于softmax模型实现手写体MNIST数字集识别
- 奔跑吧Caffe(在MNIST手写体数字集上用Caffe框架训练LeNet模型)
- Tensorflow系列之(二):详解CNN识别MNIST手写数字集
- 每天一道LeetCode-----将数字集转成字母集,计算有多少种转换方式
- 打印
- 打印
- 打印
- 打印
- 打印
- 使用绑定服务实现一个简单的音乐播放器
- Geogebra下载【linux,MacOS,windows,iOS, Android】
- testng 2 基本注解(注释)
- 开博笑话
- 递归取得当前节点下所有子节点
- 字集打印0.0
- CocoaPods详解之-Podfile.lock
- 北大ACM校赛C15I:The New MindSwitcher
- Linux shell脚本的字符串截取
- 类的扩展
- 42 data structure day-2
- 拦截导弹
- 标题: 云邦互联提供1GB免费空间(免备案,无广告)
- C++中int和string的转换