给出k个数,挑出6个,求所有组合。

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//谢谢写书的老师
int main()
{while(1){int n;cin>>n;if(n==0){break;}vector<int> da;for(int i=0;i<n;i++){int t;cin>>t;da.push_back(t);}for(int a=0;a<n;a++){for(int b=a+1;b<n;b++){for(int c=b+1;c<n;c++){for(int d=c+1;d<n;d++){for(int e=d+1;e<n;e++){for(int f=e+1;f<n;f++){cout<<da[a]<<" "<<da[b]<<" "<<da[c]<<" "<<da[d]<<" "<<da[e]<<" "<<da[f]<<endl;}}}}}}cout<<endl;}return 0;
} 

POJ 2245 Lotto G++相关推荐

  1. poj 2245 lotto

    题目链接:http://poj.org/problem?id=2245 本题属暴力搜索(递归). 注意两个点:第一:每组测试数据后都要有空行,除非下次输入k=0.第二:输出结果时每一行的最后一个数的后 ...

  2. POJ 1877 Flooded! G++

    #include <iostream> #include <cstdio> #include <algorithm> #include <iomanip> ...

  3. POJ 1838 Banana G++

    #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> ...

  4. POJ 2245 Addition Chains(算竞进阶习题)

    迭代加深dfs 每次控制序列的长度,依次加深搜索 有几个剪枝: 优化搜索顺序,从大往下枚举i, j这样能够让序列中的数尽快逼近n 对于不同i,j和可能是相等的,在枚举的时候用过的数肯定不会再被填上所以 ...

  5. POJ 2316 SPIN G++

    D位密码锁,每位有数字0到9.开始时都为0,给出数字代表每次移动对应位置次数.求最终数字. #include <iostream> using namespace std; int mai ...

  6. POJ 3077 Rounders G++

    #include <iostream> //#include <string> using namespace std; //英文没看懂 谢谢博友的翻译 int main() ...

  7. POJ 1375 Intervals G++ 几何 背

    #include <iostream> #include <cstdio> #include <cmath> #include <vector> #in ...

  8. POJ 1026 Cipher G++

    #include <iostream> #include <cstring> #include <cstdio> using namespace std; //抄博 ...

  9. POJ前面的题目算法思路【转】

    1000 A+B Problem 送分题 49% 2005-5-7 1001 Exponentiation 高精度 85% 2005-5-7 1002 487-3279 n/a 90% 2005-5- ...

最新文章

  1. 关系型数据库设计要领(值得收藏)
  2. 零代码实战 SharePoint 2013 BCS:三、实干篇
  3. 谈PC安全经验:杀毒八大错误观念
  4. 27.思科防火墙(ASA)
  5. kvm连接服务器显示不全有重影,KVM延长器系列常见问题及解决方法
  6. 【OS学习笔记】二十一 保护模式六:保户模式下操作系统内核如何加载用户程序并运行 对应的汇编代码之内核代码
  7. bpl开发模式_BPL的完整形式是什么? 什么是电力线宽带
  8. System Center 2016 Data Protection Manager 部署手册
  9. Kali Linux渗透测试实战 1.3 渗透测试的一般化流程
  10. Linux内核探索之路——关于方法
  11. 针式打印机风格英文字体_可爱漂亮的圣诞节和新年贺卡艺术字体推荐!
  12. 【离散数学】相关概念_01
  13. [ 原创 ] 概念01--中国财政真相:25省负债 全国只有6省1市在赚钱
  14. 漫画:互联网公司会议观察
  15. 深圳中科院计算机研究所,专家人才库数据----中国科学院计算技术研究所
  16. Hack The Box——Traceback
  17. 家庭NAS服务器(1)服务器的配置与选择
  18. 黑科技手机计算机,轻量又好用的黑科技APP,绝对能让你的手机能量满满!
  19. Automated pulmonary nodule detection in CT images using deep convolutional neural networks
  20. python爬取MOOC课程信息

热门文章

  1. Apollo path_bounds_decider解析
  2. 【思维导图】零基础如何把握Python学习方向
  3. 一件代发分销商城系统怎么规避拼多多、淘宝、抖店对无货源的限制,还能继续做无货源代发
  4. 在传统连连看游戏的基础上设计出新游戏增量式的创新(结对编程)(2011212026徐颖 2011212023 裴乐)
  5. 数据在网络中是如何传输的
  6. Pspice积分线路仿真问题汇总(压控电压源模拟理想运放)
  7. 在线工具, 在线网站, 好东西
  8. 在Windows Server 2008系统环境下无损调整分区
  9. 2021年科技园区规划设计方案
  10. 软件外包市场发展现状分析