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 |
不行啊,本地测试对,提交却WA,哪位大狭帮忙看看啊:#include<iostream.h> #include<iomanip.h> #include<math.h> double c(int m, int n){ int i; double s=0.0; for(i=0;i<n;i++){ s+=(double)log(m-i)-(double)log(n-i); } return s; } void main(void){ int p,q,r,s; double res1,res2,res; while(cin>>p>>q>>r>>s){ res1=c(p,q); res2=c(r,s); if(res1-res2>log(100000000)) continue; res=(double)exp(res1-res2); cout<<setiosflags(ios::fixed)<<setprecision(5)<<res<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator