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 |
少了个','In Reply To:为什么会出现Compile Error Posted by:tcxgsy at 2005-08-08 12:39:58 > #define M 1001 > #include"stdio.h" > #include"math.h" > > double aver(int a[M],int m) > { > long sum=0; > double aver; > int i,j=0; > for(i=1;i<=m;i++) > sum+=a[i]; > aver=sum/m; > for(i=1;i<=m;i++) > if(a[i]>aver) j++; > m=(double)j/(double)m; > return(m*100); > } > main() > { int n,m,i; > int a[M]; > double d; > scanf("%d",&n); > while(n) > { scanf("%d"&m); > for(i=1;i<=m;i++) > scanf("%d",&a[i]); > d=aver(a,m); > printf("%.3lf%c\n",d,'%'); > n--; > } > } > > > Compile Error > Main.c > 604945\Main.c(24) : error C2296: '&' : illegal, left operand has type 'char [3]' > 604945\Main.c(24) : error C2198: 'scanf' : too few actual parameters > > > Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator