关于学号重复的问题
Write a program that uses an array to hold course grades. Array is initialized to zero in the beginning.
Program then asks user to enter student number and then asks
user to enter grade for the student in question.
Program must check that array bounds are not violated.
User terminates input by entering -1 as student number.
In the end program calculates and prints the average of
course grades.
有输入好多学生的学号和成绩,然后当学号为负时输出成绩平均值
我的问题是,如果学号相同,即想要update一个学生的成绩是,应该怎么做呢