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 |
程序改成这样还说错误的啊,wrIn Reply To:Re:试试下面这组数据就知道了. Posted by:MasterLuo at 2008-11-29 14:17:19 #include<iostream> #include<iomanip> using namespace std; int main() { int n,k; while((cin>>n>>k)&&(n!=0)&&(k!=0)) { double s=1,s1=1; int i; if(k>n/2)k=n-k; for(i=1;i<=k;i++) { s=s*(n-i+1)/i; } cout<<setiosflags(ios::fixed)<<setprecision(0)<<s<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator