Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

真暴力的~~

Posted by wuyang1988 at 2007-08-11 18:43:35 on Problem 2245
#include<iostream>
using namespace std;
int main()
{
	int n,i,a[13],j,k,l,m,p;
	cin>>n;
	while(n)
	{
		for(i=1;i<=n;i++)
			cin>>a[i];
		for(i=1;i<=n-5;i++)
			for(j=i+1;j<=n-4;j++)
				for(k=j+1;k<=n-3;k++)
					for(l=k+1;l<=n-2;l++)
						for(m=l+1;m<=n-1;m++)
							for(p=m+1;p<=n;p++)
								cout<<a[i]<<" "<<a[j]<<" "<<a[k]<<" "<<a[l]<<" "<<a[m]<<" "<<a[p]<<endl;
	cin>>n;
	}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator