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

2302580085何盈菲 #59

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

2302580085何盈菲 #59

postureF opened this issue Mar 11, 2024 · 0 comments

Comments

@postureF
Copy link

postureF commented Mar 11, 2024

#include <stdio.h>
#include <stdlib.h>
typedef struct {
int id;
float score;
} Student;

void input_students(Student* students, int n) {
for (int i = 0; i < n; i++) {
printf("请输入第%d个学生的学号: ", i + 1);
scanf("%d", &students[i].id);
printf("请输入%d的考试成绩: ", students[i].id);
scanf("%f", &students[i].score);
}
}

int x,y,z;int temp;
for(x = 0;x<n-1;x++){
z = x;
for(y =y+1;y<n;y++){
if(student[y] > student[z])
z = y;
temp = student[z];student[z] = student[x];student[x] = temp;
printf("student[z],studennt[y],student[x]");
}
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