题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5753
Sample Input Sample Output
6.000000
52.833333
分析:???
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<queue>
#include<algorithm>
#include<time.h>
using namespace std; const int maxn = ;
const int N=; #define lson rt<<1///rt*2
#define rson rt<<1|1///rt*2+1 int main()
{
int n,i;
int a[]; while(scanf("%d", &n) != EOF)
{
int sum=;
for(i=;i<=n;i++)
scanf("%d", &a[i]); if(n==)
printf("%lf\n",1.0*a[]);
else if(n==)
printf("%lf\n",1.0*(a[]+a[])/);
else
{
for(i=;i<n;i++)
sum+=a[i];
int x=a[]+a[n]; printf("%lf\n", 1.0*x/+1.0*sum/);
}
}
return ;
}