Try to code on my pad lol

This commit is contained in:
juan 2021-12-20 23:30:33 +08:00
parent 53b7792b4e
commit 5dee97aa6e

View file

@ -110,7 +110,7 @@ void update(char *id, int *scores, STUDENT *students, int size) { // 3
int loc = match(id, students, size);
if (loc == -1) {
printf("Students do not exist\n");
return;
return;
}
// Update the student
@ -124,13 +124,13 @@ void display(char *id, STUDENT *students, int size) { // 4
int loc = match(id, students, size);
if (loc == -1) {
printf("Students do not exist\n");
return;
return;
}
// Display the average score
int sum = 0;
for (int i = 0; i < CLASS; i++) {
/* printf("score[%d]: %d\n", i, students[loc].scores[i]); */
/* printf("score[%d]: %d\n", i, students[loc].scores[i]); */
sum += students[loc].scores[i];
}
printf("Student ID:%s\nName:%s\nAverage Score:%.1f\n", id, students[loc].name,