Home > Back-end >  For help: the Runtime Error: Segmentation faults, but found no bosses say is too small or pointer ex
For help: the Runtime Error: Segmentation faults, but found no bosses say is too small or pointer ex

Time:01-02

The topic of a school, the school system Error: the Runtime Error: Segmentation faults, but found no bosses say an array of opening is too small or pointer exception,
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- the following is a topic -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Title description
Enter multiple student's student id, name and grades, and then the output result which the highest student name and student id
The input description
Input contains multiple sets of sample,
Each set of sample contains an integer N, on behalf of the students have N,

The next N lines input in turn each student's student id, name and grades,
If N=0, the end of said input, this sample does not need to be treated,

Output description
For each set of use cases, you should be the output of this group of sample N students scored the highest student name and student id, accounts for each output line,
Tip

Copy the sample input sample input data
? 2
1000 mingming 89

1001 lingling 90

3

1090 huanghuang 88

1076 zhouzhou 76

1003 xiaohong 87

0
Sample output
Lingling 1001
1090 huanghuang
Allow the longest running time
3000 ms
Allows the use of maximum memory
1025 MB
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- is more than the title -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- my code: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# include
Struct student
{
int number;
Char name [100].
Int score;
//int len.
};
Void mystructioncontempt (struct student x [], int len)
{
int i=0;
//printf (" len=% d \ n ", len);
Struct student Max=x [0];
For (;; )
{//printf (" mark 2 \ n ");
If (Max. Score//printf (" % d % s ", Max. The number, Max. The name).
i++;
//printf (" I=% d len=% d \ n ", I, len);
If (I==len)
{
Printf (" % d % s \ n ", Max. The number, Max. The name).
break;
}
}
}
Int main ()
{
Struct student s [100] [100].
Int len [100].
Int I, j, n.
Int flag=0;
For (I=0;; I++)
{
The scanf (" % d ", & amp; n);
If (n==0) break;
The else
{//printf (" three mark \ n ");
Len [I]=n;
//printf (" len [% d]=% d \ n ", I, n);
Flag++;
for(j=0; j{
//s [I] [j]. Len=n;
The scanf (" % d % d % s ", & amp; S [I] [j]. Journal of number, s [I] [j]. Name, & amp; S [I] [j]. Journal of score);
//printf (" mark 2 \ n ");
}
}
}
i=0;
For (;; )
{
Mystructioncontempt (s [I], len [I]);
i++;
If (I==flag) break;
}
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Test software devc++ 5.11 compile function not found the problem, really don't know where the problem is for help bosses

CodePudding user response:

People shout
  • Related