From f30c71b80828c47aa9b5adde8f5514cbe04d3fe0 Mon Sep 17 00:00:00 2001 From: Matus Tokarcik Date: Thu, 28 Mar 2024 21:55:56 +0100 Subject: [PATCH] a1 --- a1/program.c | 19 +++++++++++++------ a1/program.exe | Bin 66598 -> 66598 bytes 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/a1/program.c b/a1/program.c index f9b6d94..004c252 100644 --- a/a1/program.c +++ b/a1/program.c @@ -12,20 +12,20 @@ int main(){ double vysledok; char znamienko; char* token; + char vysledky[50][50]; // pole pre ukladanie vysledkov + int pocet = 0; while (1) { - char* a = fgets(pole, 100, stdin); - // Kontrola, či je riadok prázdny - if (pole[0] == '\n') { + if (pole[0] == '\n') { //ci je riadok prazdny, ci sa stlacil enter break; } token = strtok(pole, " "); //rozdelenie retazca podla medzier cislo1 = atof(token); // premena stringu na desatinne cislo a priradenie cislu1 token = strtok(NULL, " "); //pokracovanie v rozdelovani retazca - znamienko = token[0]; // vrati ukazatel na nasledujuci token, cize znamienko + znamienko = token[0]; //vrati ukazatel na nasledujuci token, cize znamienko token = strtok(NULL, " =\n"); cislo2 = atof(token); token = strtok(NULL, " =\n"); @@ -50,12 +50,19 @@ int main(){ printf("CHYBA\n"); return 1; } + if (realny == vysledok){ - printf ("OK\n"); + strcpy(vysledky[pocet], "OK"); //kopiruje vysledok do pola vysledky } else{ - printf ("ZLE\n"); + strcpy(vysledky[pocet], "ZLE"); } + pocet++; + } + + //vypis vysledkov + for (int i = 0; i < pocet; i++) { + printf("%s\n", vysledky[i]); } return 0; diff --git a/a1/program.exe b/a1/program.exe index 9d5cd001f098df3b67008f49e75d45f10a6b41c7..e0fe45baee58c73880d22e78e4fdfa94bce0e9a0 100644 GIT binary patch delta 3512 zcmai1eN>cH8ozgjff>HuL1u(eByb#{EErO=R+Ep!UJKok)dWAOJiwYCl(>01=HL!f zj_jvs#P=-Lbm~N8wr(cjs4yC9b|^io_)``&;9+L zulw9*o_WvA-Yp?}w}jMeQRTMRZk?;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