Home > Back-end >  C grade code collapsed
C grade code collapsed

Time:10-12

# include & lt; String>
# include & lt; Algorithm>
# include & lt; Deque>
# include & lt; Vector>
# include & lt; iostream>
# include & lt; Ctime>
using namespace std;


The class person
{
Public:
The person (string name, int score)
{
This - & gt; NAME=NAME;
This - & gt; SCORE=SCORE;
}

String NAME;
Int SCORE;
};
Void peopleCreate (vector & V)
{
String sp [5]={" uzi ", "jackeylove", "bin", "knight", "xiye"};
Int score=0;
for (int i=0; I & lt; 5; I++)
{
Person p ([I] sp, score);
Valerie plame ush_back (p);
}
}
Void setScore (vector & V)
{
For (vector : : iterator it=what exactly do v.begin (); It!=v.e nd (); It++)
{
Deque d;
int sum=0;
for (int i=0; I & lt; 10; I++)
{
Int score=rand () % 41 + 60;

D.p ush_back (score);
}
Sort (db do v.begin (), d.e nd ());
D.p op_back ();
D.p op_front ();
For (deque : : iterator dt=db do v.begin (); Dt!=d.e nd (); It++)
{
The sum +=* dt;
}
Int avg=sum/d.s considering ();
It - & gt; SCORE=avg;
}

}
Void showInfo (vector & V)
{
For (vector : : iterator it=what exactly do v.begin (); It!=v.e nd (); It++)
{
cout<"Name:" & lt; }
}

Int main ()
{
Srand ((unsigned int) time (NULL));
Vector v;
PeopleCreate (v);
SetScore (v);
ShowInfo (v);
system("pause");
return 0;
}

CodePudding user response:

Linux:
Process exit would have a "core" in the current directory files or form such as' core. The digital files such as' core. 1234 '
Using the command
GDB to run the program of the core or the core. The digital
Enter the GDB and then use the bt command
Can view the process exit before the function call stack, content is from the top to the following out of from the inner to outer function call history,
If process exit does not produce the core file, the reference "ulimit -c size the most large core file" command

Windows:
Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,
  • Related