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 |
Please give me some tips!(So easy,but I can't do it very well)#include<stdio.h> int main() { int n,m,ans,i,j; while(1){ scanf("%d%d",&n,&m); if(m==0&&n==0) break; ans=1; for(i=n+m,j=1;i>=m+1;j++,i--) ans=ans*i/j; printf("%d\n",ans); } return 0; } //Time Limit Exceeded Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator