oooodchod
This commit is contained in:
parent
8024ab010a
commit
2d4ddd79cc
@ -28,16 +28,17 @@ int compare_students(const void* a, const void* b) {
|
||||
int main() {
|
||||
// Databáza študentov s preddefinovanými hodnotami
|
||||
struct Student students[MAX_STUDENTS] = {
|
||||
{"Terian Dis", 10}, // Terian Dis má 10 hlasov
|
||||
{"Bardos Mrtakrys", 2},
|
||||
{"Rita Umhi", 1},
|
||||
{"Prylenn Alak", 1},
|
||||
{"Lak'hi Elavorg", 10},
|
||||
{"Lak'hi Elavorg", 9}, // Lak'hi Elavorg má menej ako 10 hlasov
|
||||
{"Prylenn Alak", 3},
|
||||
{"Prylenn Alak", 3},
|
||||
{"Prylenn Alak", 3},
|
||||
{"Rita Umhi", 1}
|
||||
};
|
||||
int num_students = 8; // Počet študentov v databáze
|
||||
int num_students = 9; // Počet študentov v databáze
|
||||
|
||||
// Zoradenie študentov podľa počtu hlasov a mena
|
||||
qsort(students, num_students, sizeof(struct Student), compare_students);
|
||||
|
Loading…
Reference in New Issue
Block a user