#include <stdio.h>
typedef struct {
int num;
char name[20];
float score;
} Student;
int main() {
Student std[5] = {
{1,"Jae-won",95.5},
{2,"Min-soo",88.0},
{3,"Gildong",95.5},
{4,"Ha-na",92.0},
{5,"Duri",89.0}
};
Student temp;
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 4; j++) {
if (std[j].score > std[j + 1].score) {
temp = std[j];
std[j] = std[j + 1];
std[j + 1] = temp;
}
}
}
for (int i = 0; i < 5; i++) {
printf("%.1f ",std[i].score);
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: