k<13呀 直接六重循环暴力! #include <iostream> using namespace std; int a[20],n,i,j,k,p,q,r; int main() { while (cin >> n && 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 (p=k+1;p<=n-2;p++) for (q=p+1;q<=n-1;q++) for (r=q+1;r<=n;r++) printf("%d %d %d %d %d %d/n",a[i],a[j],a[k],a[p],a[q],a[r]); printf("/n"); } //system("pause"); return 0; }