Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

王中第 #49

Open
miantt opened this issue Mar 11, 2024 · 0 comments
Open

王中第 #49

miantt opened this issue Mar 11, 2024 · 0 comments

Comments

@miantt
Copy link

miantt commented Mar 11, 2024

Student* students = (Student*)malloc(n * sizeof(Student));

input_students(students, n);
sort_students(students, n);

printf("\n学号\t成绩\n");
for (int i = 0; i < n; i++) {
printf("%d\t%.2f\n", students[i].id, students[i].score);
}

float avg_score = calculate_avg_score(students, n);
int failed_count = count_failed_students(students, n);

printf("\n平均成绩: %.2f\n", avg_score);
printf("不及格人数: %d\n", failed_count);
free(students);
return 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant