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 sndnyangd at 2011-01-26 22:09:20 on Problem 2245
标记下,附代码:
#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:
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