Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

mark至少要1001,if((float)mark[j]>=avr不能要=,scanf("%d",&num);往后移

Posted by raymond8023 at 2007-11-07 14:28:25 on Problem 2350
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator