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 |
提交就WA,请高手看看#include<stdio.h> #define max 100 double ReturnCn(int n,double c[]) { int i=0,count=0; double sum=0.0; int temp=n; for(i=0;i<temp;i++) { sum=sum+c[i]; } /*while(count<n) { for(i=0;i<temp;i++) { sum=sum+c[i]; } temp--; count++; }*/ return sum; } int main() { int n; while(scanf("%d",&n)==1) { double a0,a,a1; scanf("%lf%lf",&a0,&a); double *c=new double[max]; int i; for(i=0;i<n;i++) { scanf("%lf",c+i); } /*double x=ReturnCn(n,c); printf("%0.2lf\n",x);*/ a1=((a-a0)/(n+1))+a0-ReturnCn(n,c); printf("%0.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