Home > Back-end >  C language, simple performance management system to help see me where I wrong
C language, simple performance management system to help see me where I wrong

Time:12-06

# include
# define N 100
Float a, [N]. Float b [N]. int num;
Float ave (float a [N], int num);
Void rank (float a [N], float b [N], int num);
Float the find (float a [N], int num);

Int main (void)
{
int i;
Printf (" a total of a few exam? \n");
The scanf (" % d ", & amp; Num);
Printf (" please input results in turn \ n ");
for(i=0; iThe scanf (" % d ", & amp; A [I]);

Float e;
E=ave (a, num);
Printf (" average: % f \ n ", e);

Printf (" from big to small order total score: \ n ");
Void rank (float a [N], float b [N], int num);
for(i=0; iPrintf (" % f \ n ", [I] b);

Int y;
Printf (" input to find grades: \ n ");
The scanf (" % f ", & amp; Num);
Y=find (a, num);
If (yPrintf (" % d ", y);
The else printf (" no accord with grades \ n ");
return 0;


}

Float ave (float a [N], int num)
{
int i; Float sum, aver;
for(i=0; iThe sum +=a [I]; Aver=sum/num;
Return aver.
}

Void rank (float a [N], float b [N], int num)
{
Int I, j, k;
for(i=0; iB=[I] a [I];

for(i=0; ifor(j=1; J{if (b [1] & gt; B [j])
K=b [j]; B=b [j] [j + 1); B [m + 1]=k; }
}

Float the find (float a [N], int num)
{
Int res=0; int i;
for(i=0; i{if (a==[I] num)
{res=I; return res; }}
If (res==0)
Res=num + 1;
return res;

}

CodePudding user response:

What is error message?

CodePudding user response:

Float ave (float a [N], int num)
{
int i; Float sum, aver;
for(i=0; iThe sum +=a [I]; Aver=sum/num;
Return aver.
}

Here the sum to initialize, float sum=0;
  • Related