From b18842fbca0c317029f8050468631ecca81974a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=A9re=C5=A1?= Date: Tue, 29 Oct 2019 13:37:38 +0000 Subject: [PATCH] Aktualizovat "program.c --- program.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/program.c b/program.c index 1443c9a..42c5c76 100644 --- a/program.c +++ b/program.c @@ -15,9 +15,13 @@ int main() { } int cislo1 = strtof(strtok(prve_cislo,"\n"),NULL); + printf("Nacitane %d\n",cislo1); + int cislo2; while((fgets(druhe_cislo,100,stdin))){ cislo2= strtof(strtok(druhe_cislo,"\n"),NULL); + int buf_C_1 = cislo1; + int buf_C_2 = cislo2; while (cislo1 != cislo2){ if (cislo1 > cislo2){ cislo1 -= cislo2; @@ -25,6 +29,7 @@ int main() { cislo2 -= cislo1; } } + if (isalpha(*prve_cislo)){ printf("%s je neplatny zapis.\n",prve_cislo); free(prve_cislo); @@ -32,7 +37,8 @@ int main() { return 0; } - printf("%d",cislo1); + printf("Nacitane %d\n",cislo1); + printf("Najvacsi spolocny delitel cisel %ld a %ld je %ld\n",buf_C_1,buf_C_2,cislo1); } free(prve_cislo);