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<iostream> using namespace std; double com(double m, double n){ if(n > m - n){ n = m - n; } double sum,i; sum = 1.0; for(i = m; i > m - n; i--){ sum *= i / (i - m + n); } return sum; } int main(){ double m, n; while(cin>>m>>n){ if(m == 0.0 && n == 0.0){ break; } printf("%.0lf\n",com(m+n,m)); } return 0; } 输出为什么只能用printf %.0lf 用cout(int)就wa 用cout(floor)也是wa Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator