Home > Back-end >  C beginners, excuse me each brother what is the problem?
C beginners, excuse me each brother what is the problem?

Time:09-18

# include & lt; stdio.h>
# include & lt; Stdlib. H>
# include & lt; Conio. H>

Struct student
{
Int number;
Char name [20].
Float cj1;
Float cj2;
Float cj3;
} dota [10].

Void SRXX ()
{
int i;
Printf (" please enter the student information \ n ");
for (i=0; I & lt;=9; I++)
{
The scanf (" % d % s % f % f % f ", & amp; Dota [I] number, dota [I]. Name, & amp; Dota [I]. Cj1, & amp; Dota [I]. Cj2, & amp; Dota [I] cj3);
}
for (i=0; I & lt;=9; I++)
Printf (" % d % 7 July s % 7.1 f % f7.1 % f \ n ", & amp; Dota [I] number, dota [I]. Name, & amp; Dota [I]. Cj1, & amp; Dota [I]. Cj2, & amp; Dota [I] cj3);
}
The main ()
{
Int ch;
Void SRXX ();
While (1)
{
System (" CLS ");
Printf (" student achievement management system \ n ");
Printf (" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \ n ");
Printf (" 1 -- -- -- student information input \ n ");
Printf (" 2 - student performance statistics \ n ");
Printf (" 3 - student achievement sorting \ n ");
Printf (" 4 - student achievement inquiry \ n ");
Printf (" 0 - exit system \ n ");
Printf (" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \ n ");
Printf (" please select 0-4: ");
The scanf (" % d ", & amp; Ch);
The switch (ch)
{
Case 0: printf (" exit system! \n"); exit(0);
Case 1: SRXX (); break;
}
Printf (" press any key to continue... ");
}
Getch ();
}

CodePudding user response:

The first step in the input information, why not success?

CodePudding user response:

Information to lose 10 students, each student upload remember to press the enter key, remove the address in the printf operator & amp; , getch (); Functions within a while loop, and the main function return value int good habit, don't forget to return 0;
  • Related