cv10
This commit is contained in:
parent
1c4bcb18c1
commit
db25582ebc
@ -11,6 +11,12 @@ int porovnaj_mena(const void *a, const void *b) {
|
||||
}
|
||||
|
||||
int main() {
|
||||
int pocet_prijatych;
|
||||
if (scanf("%d\n", &pocet_prijatych) != 1 || pocet_prijatych <= 0) {
|
||||
puts("Nespravny vstup");
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *pole_smernikov[SIZE];
|
||||
memset(pole_smernikov, 0, SIZE * sizeof(char *));
|
||||
int pocet_mien_v_poli = 0;
|
||||
@ -45,7 +51,8 @@ int main() {
|
||||
qsort(pole_smernikov, pocet_mien_v_poli, sizeof(char *), porovnaj_mena);
|
||||
|
||||
// Vypísanie zotriedených mien
|
||||
for (int i = 0; i < pocet_mien_v_poli; i++) {
|
||||
printf("Prijati studenti:\n");
|
||||
for (int i = 0; i < pocet_prijatych && i < pocet_mien_v_poli; i++) {
|
||||
printf("%s\n", pole_smernikov[i]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user