fix dalsi asi
This commit is contained in:
parent
fc66796acc
commit
f43431e8fc
@ -7,10 +7,10 @@ int main() {
|
||||
int pocet_studentov = 0;
|
||||
int ziadne_mena = 1;
|
||||
|
||||
char first_input[100];
|
||||
if (fgets(first_input, sizeof(first_input), stdin) == NULL) {
|
||||
char prvy_input[100];
|
||||
if (fgets(prvy_input, sizeof(prvy_input), stdin) == NULL || atoi(prvy_input) <= 0) {
|
||||
printf("Nespravny vstup\n");
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (fgets(pole[pocet_studentov], sizeof(pole[pocet_studentov]), stdin) != NULL) {
|
||||
@ -50,7 +50,7 @@ int main() {
|
||||
}
|
||||
|
||||
printf("Prijati studenti:\n");
|
||||
int pocet = atoi(first_input);
|
||||
int pocet = atoi(prvy_input);
|
||||
for (int i = 0; i < pocet && i < pocet_studentov; i++) {
|
||||
printf("%s\n", pole[i]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user