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 |
表太炫,不让别人独立思考啊~~~~In Reply To:我的 c, 简单哦^_^ Posted by:gardner at 2005-10-12 02:01:13 > #include <stdio.h> > #include <math.h> > void main() > { > int num,i,j; > double temp; > double input[101]={0}; > scanf("%d",&num); > for(i=0;i<num;i++)scanf("%lf",&input[i]); > if(num==1)printf("%.3lf\n",input[0]); > else { > for(i=0;i<num;i++){ > for(j=num-2;j>=i;j--)if(input[j]>input[j+1]){ > temp=input[j]; > input[j]=input[j+1]; > input[j+1]=temp; > } > } > for(i=num-2;i>=0;i--){ > input[i]=2*sqrt(input[i]*input[i+1]); > } > printf("%.3lf\n",input[0]); > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator