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

无论n是奇数还是偶数最后的结果都应该按浮点或者双精度的形式保留一个小数输出。

Posted by chenweiwei at 2009-06-14 19:16:33 on Problem 2623
至于为什么。其实我也不大明白。
if(n%2!=0)
	{
		printf("%d\n",v[(n-1)/2]);//这样是wa的,因为题目说过要保留一位小数点
	}
	else
	{
		printf("%.1f\n",v[n/2]/2.0+v[n/2-1]/2.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