Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这道题让我学会了用%g,呵呵*^◎^*

Posted by TSERROF at 2012-08-27 10:00:58 on Problem 3507
#include<cstdio>
int main()
{
	while(1)
	{
	    double T=6,t,sum=0,max=0,min=999;
	    while(T--)
	    {
			scanf("%lf",&t);
		        sum+=t;
			if(t<min)min=t;
			if(t>max)max=t;
	    }
		if(sum==0)break;
		printf("%g\n",(sum-max-min)/4.0);
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator