Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
艰难过了第五十题,庆祝下标记下,附代码: #include <stdio.h> #include<stdlib.h> int n; void Write(int a[],int t[],int m,int p) { int i; if(p==6) { for(i=0;i<6;i++) printf("%d ",a[i]); printf("\n"); return ; } for(i=m;i<=m+n-6&&i<n;i++) { a[p]=t[i]; //在这里一度出错,两个都是I,结果输出来输出去都没变。。 Write(a,t,i+1,p+1); } } int main() { int i; int t[15],a[6]; while(1) { scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++) scanf("%d",&t[i]); Write(a,t,0,0); printf("\n"); } system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator