push
This commit is contained in:
parent
72c56a7686
commit
9fd9868695
@ -14,6 +14,7 @@ struct student {
|
|||||||
int najdi_studenta(struct student* studenti, int pocet, const char* meno) {
|
int najdi_studenta(struct student* studenti, int pocet, const char* meno) {
|
||||||
|
|
||||||
for (int i = 0; i < pocet; i++) {
|
for (int i = 0; i < pocet; i++) {
|
||||||
|
|
||||||
if (strcmp(studenti[i].meno, meno) == 0) {
|
if (strcmp(studenti[i].meno, meno) == 0) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -49,8 +50,8 @@ int main() {
|
|||||||
char* koniec = NULL;
|
char* koniec = NULL;
|
||||||
int hodnota = (int)strtol(riadok, &koniec, 10);
|
int hodnota = (int)strtol(riadok, &koniec, 10);
|
||||||
|
|
||||||
if (koniec == riadok) {
|
if (koniec == riadok || hodnota == 0) {
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*koniec == ' ') {
|
while (*koniec == ' ') {
|
||||||
@ -70,6 +71,7 @@ int main() {
|
|||||||
if (zaciatok_mena[velkost_mena - 1] == '\n') {
|
if (zaciatok_mena[velkost_mena - 1] == '\n') {
|
||||||
velkost_mena--;
|
velkost_mena--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (velkost_mena <= 0) {
|
if (velkost_mena <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user