From 36532249e8a24a0d2a4bd62232278a20d21412ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=A9re=C5=A1?= Date: Sun, 10 Nov 2019 15:59:02 +0000 Subject: [PATCH] Aktualizovat "program.c --- program.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/program.c b/program.c index e827960..0e5964e 100644 --- a/program.c +++ b/program.c @@ -31,7 +31,13 @@ int main() { if (!isdigit(*prvy_vstup)){ printf("%s je neplatny zapis.\n",prvy_vstup); goto koniec; - } else{ + } + else if (prve_cislo = strtoull(prvy_vstup,NULL,0) == ULLONG_MAX){ + printf("%s je mimo rozsahu.\n",prvy_vstup); + goto koniec; + } + + else{ printf("Nacitane %llu\n",prve_cislo = strtoull(prvy_vstup,NULL,0)); } } @@ -52,10 +58,7 @@ int main() { goto koniec; } - else if (prve_cislo == ULLONG_MAX){ - printf("%s je mimo rozsahu.\n",prvy_vstup); - goto koniec; - } else{ + else{ unsigned long long int vysledok = nsd(prve_cislo,druhe_cislo = strtoull(druhy_vstup,NULL,0)); printf("Nacitane %llu\n",druhe_cislo); printf("Najvacsi spolocny delitel cisel %llu a %llu je %llu\n",prve_cislo,druhe_cislo,vysledok);