There are one or more classes of students, followed by a final line containing only the value -1. Each class starts with a line containing an integer, n, which is the number of students in the class, followed by n lines of student information. Each line of student information consists of three positive integers, representing the dimensions of the clay block, followed by the student's first name. There can never be more than 9 students nor less than 2 students in any class. Each student's name is at most 8 characters. Ms. Terry always gives each student at most 250 cubic units of clay. There is exactly one bully and one victim in each class.
代码都是简单的,关键没通过的原因是:对字符串的理解不够,什么是最多八个字符?直接定义字符数组name[8]?,其实我在这里忽略了字符串在数组中的存放原则,它最终要在后面加上一个'\0',才能构成字符串,所以应该定义为name[9],以后一定要注意,加油!!!