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 |
mark至少要1001,if((float)mark[j]>=avr不能要=,scanf("%d",&num);往后移In Reply To:怎么会编译出错呢?哪位大牛帮忙看一下: Posted by:Loonlie at 2007-05-25 17:55:02 > int main(){ > int i,num; > int mark[1000]; > scanf("%d",&num); > int n,m,j; > float k; > float avr; > i=num; > while(i>0){ > scanf("%d",&mark[0]); > for(n=1;n<=mark[0];n++){scanf("%d",&mark[n]);} > avr=0; > for(m=1;m<=mark[0];m++){avr=avr+mark[m];} > avr=avr/mark[0]; > k=0; > for(j=1;j<=mark[0];j++){if((float)mark[j]>=avr)k++;} > printf("%.3f%%\n",(k/mark[0])*100); > i--; > } > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator