123
This commit is contained in:
parent
ba796e0c40
commit
10a84b9550
@ -12,7 +12,7 @@ int main() {
|
|||||||
prihlasky = (char **)malloc(max * sizeof(char *));
|
prihlasky = (char **)malloc(max * sizeof(char *));
|
||||||
if (scanf("%d", &max) != 1 || max <= 0) {
|
if (scanf("%d", &max) != 1 || max <= 0) {
|
||||||
puts("Nespravny vstup");
|
puts("Nespravny vstup");
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
fgets(name, 50, stdin);
|
fgets(name, 50, stdin);
|
||||||
while (fgets(name, 50, stdin) && name[0] != '\n') {
|
while (fgets(name, 50, stdin) && name[0] != '\n') {
|
||||||
@ -26,6 +26,10 @@ int main() {
|
|||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(counter == 0){
|
||||||
|
puts("Ziadne prihlasky");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
qsort(prihlasky, counter, sizeof(char *), compare);
|
qsort(prihlasky, counter, sizeof(char *), compare);
|
||||||
puts("Prijati studenti:");
|
puts("Prijati studenti:");
|
||||||
for (int i = 0; i < max && i < counter; i++) {
|
for (int i = 0; i < max && i < counter; i++) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user