Home > Back-end >  How to input this code information!!
How to input this code information!!

Time:10-06

#include
Struct student
{
int num;
Char name [100].
Int computer, English, math,
Double business;
};
Int main (void)
{
Int I, index, j, n;
Struct student students [50], temp;

Printf (" Input n: ");
The scanf (" % d ", & amp; N);
for (i=0; i{
Printf (" Input the info of No. % d \ n ", I + 1);
Printf (" number: ");
The scanf (" % d ", & amp; Students [I] num);
Printf (" name: ");
The scanf (" % d ", & amp; Students [I] name);
Printf (" math score: ");
The scanf (" % d ", & amp; Students [I]. Math);
Printf (" English score: ");
The scanf (" % d ", & amp; Students [I]. English);
Printf (" computer score: ");
The scanf (" % d ", & amp; Students [I]. Computer);
Student [I] business=(students [I]. Math + students [I] English + students [I]. Computer)/3.0;

}
For (I=0; i{
The index=I;
For (j=I + 1; jIf (stduents [j] average> Atudents [index]. Business)
The index=j;
Temp=students [index];
students

CodePudding user response:

The scanf (" % d ", & amp; Students [I] name);
This sentence to
The scanf ( "% s", students [I] name ).
Because the name is a character array, is not an integer

CodePudding user response:

Fun
reference 1 floor response:
the scanf (" % d ", & amp; Students [I] name);
This sentence to
The scanf ( "% s", students [I] name ).
Because the name is a character array, is not the integer

Well well, know
  • Related