| ||||||||||
| 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 | |||||||||
无论n是奇数还是偶数最后的结果都应该按浮点或者双精度的形式保留一个小数输出。至于为什么。其实我也不大明白。
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator