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 |
用GCC 一直WA,换成C++ 一次就AC???#include <stdio.h> #include <stdlib.h> int main() { int n; double c[3002]={0}; double a0,an; scanf("%d",&n); scanf("%lf%lf",&a0,&an); double sum=0; int i; for(i=0;i<n;i++) { scanf("%lf",&c[i]); sum += 2*(n-i)*c[i]; } double a1 = (n*a0+an-sum)/(n+1); printf("%.2lf\n",a1); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator