diff --git a/cv10/program.c b/cv10/program.c index 9776b0e..5cb434f 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -40,10 +40,13 @@ int main() { num_accepted++; } num_students++; + + // Check if we have reached the maximum number of accepted students + if (num_accepted == max_students) { + break; // Exit the loop + } } - names[num_accepted][0] = '\0'; - qsort(names, num_accepted, sizeof(char*) * NAME_SIZE, compare_names); if (num_accepted == 0) { @@ -56,4 +59,4 @@ int main() { } return 0; -} \ No newline at end of file +}