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 |
不止6个数据呀!!!In Reply To:那里不对啊?帮忙看看!!! Posted by:hbu_asd at 2005-09-14 18:09:47 > #include"stdio.h" > double qwe(int x,int y) > {double sum=1.0; > if(x==y)return 1.0; > while(1) > {sum=sum*x; > x--; > if(x==y)break; > } > return sum; > } > double shu(int p,int q,int r,int s) > {double m=1.0,n=1.0; > > if(q>r||s>p||p==q||r==s){m*=qwe(p,q);n=qwe(r,s);} > else{ if(p>r)m*=qwe(p,r); > else {if(p-r<0)n=qwe(r,p);} > if(q-s>0)n*=qwe(q,s); > else {if(s-q>0)m*=qwe(s,q);} > } > if((p-q)-(r-s)>0)n*=qwe(p-q,r-s); > else {if((p-q)-(r-s)<0)m*=qwe(r-s,p-q);} > > return m/n; > } > > void main() > {double shu(int p,int q,int r,int s); > int p,q,r,s,i; > double a[6]; > for(i=0;i<6;i++) > {scanf("%d%d%d%d",&p,&q,&r,&s); > a[i]=shu(p,q,r,s); > } > for(i=0;i<6;i++) > printf("%.5lf\n",a[i]); > > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator