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 snowfall at 2008-03-22 21:16:44 on Problem 2249
#include<stdio.h>
main()
{
     double sum;
     unsigned long i,k,n;
     scanf("%ld %ld",&n,&k);
     while(n!=0)
     {  
         if(k>n/2) k=n-k;
         sum=n/k; 

         for(i=1;i<k;i++)
          { sum=sum/(k-i);
            sum=sum*(n-i);
          } 

         printf("%.0f\n",sum);
         scanf("%ld %ld",&n,&k);       
     }
}

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