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

2302580088覃诗语 #65

Open
Songqvq opened this issue Mar 12, 2024 · 0 comments
Open

2302580088覃诗语 #65

Songqvq opened this issue Mar 12, 2024 · 0 comments

Comments

@Songqvq
Copy link

Songqvq commented Mar 12, 2024

#include<stdio.h>
#include<string.h>
typedef struct
{
int studentID;
char name[20];
float grades[4];
float average;
int rank;
}
Student;
void sortStudents(Student student[],int numStudents);
void printRankings(Student student[],int numStudents);
int main(){
Student student[MAX_STUDENTS];
for(int i=0;i<MAX_STUDENTS;i++){
Student nesStudent;
printf("请输入学号,姓名和课程成绩\n"i+1);
scanf("%d %s %f ",&(newStudent.studentID),newStudent.name,&(newStudent.grades[0]));
students[i]=newStudent;
numStudents++;
}
int main() {
int n;
printf("请输入学生人数:");
scanf("%d",&n);
Student* students = (Student*)malloc(n * sizeof(Student));
}

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