poj2245
#include<stdio.h> #define maxn 100 int f[maxn]; void Find(int a[], int N, int k)
{
int i; if(k == 6)
{
for(i=0; i<6; i++)
printf("%d%c", f[i], i==5?'\n':' ');
return ;
} for(i=0; i<N; i++)
{
f[k] = a[i];
Find(a+i+1, N-i-1, k+1);
}
} int main()
{
int n, k=0; while(scanf("%d", &n), n)
{
int i, a[maxn]; if(k++)printf("\n"); for(i=0; i<n; i++)
scanf("%d", &a[i]); Find(a, n, 0);
} return 0;
}
poj2245的更多相关文章
- POJ2245 Lotto
Lotto Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6634 Accepted: 4201 Description ...
随机推荐
- Sql server 数据库中,纯SQL语句查询、执行 单引号问题。
在默认值情况下, select 'abc',Titile from tb_Name; ---输出内容 是abc: 如果想输出 单引号 'abc,需要使用select '''abc',Titile f ...
- C# Chart圖標綁定
开发软件为VS2010 免去了安装插件之类的麻烦. 最终效果图: 饼状图: 前台设置:设置参数为: :Titles, 添加一个序列,在Text中设置名字. :Series ,添加一个序列,选择Char ...
- ssh框架配置事务管理器
http://blog.163.com/zsq303288862@126/blog/static/9374596120111182446727/
- XFire构建服务端Service的两种方式(转)
XFire构建服务端service的两种方式,一是用xfire构建,二是和spring集成构建. 一,xifre构建,确保把xfire的jar包导入到工程中或classpath. 1,service的 ...
- 使用charles proxy for Mac来抓取手机App的网络包
之前做Web项目的时候,经常会使用Fiddler(Windows下).Charles Proxy(Mac下)来抓包,调试一些东西:现在搞Android App开发,有时候也需要分析手机App的网络请求 ...
- IIViewDeckController的使用,左右拖拉菜单效果实现
博客园 IIViewDeckController的使用,左右拖拉菜单效果实现 很多应用里面都实现了对应的侧拉 显示隐藏的效果,看起来很符合用户体验的类似于这种 看起来很好看,今天去晚上搜下 ...
- node http.get请求
var http = require('http'); var querystring = require('querystring') var url = 'http://www.baidu.com ...
- SGU 275 To xor or not to xor(高斯消元)
题意: 从n个数中选若干个数,使它们的异或和最大.n<=100 Solution 经典的异或高斯消元. //O(60*n) #include <iostream> using nam ...
- WHU 1579 Big data (DP)
题意: f[0]=0,f[i]=f[i-1]+a or b. 求满足L<=∑f[n]<=R的序列的种数 n<100. |a|,|b|<=10000. |L|,|R|< ...
- 【POJ1568】【极大极小搜索+alpha-beta剪枝】Find the Winning Move
Description 4x4 tic-tac-toe is played on a board with four rows (numbered 0 to 3 from top to bottom) ...