From 33a03de6ba045747306d2d6a01d3e0cff38e52f6 Mon Sep 17 00:00:00 2001 From: Matus Tokarcik Date: Thu, 28 Mar 2024 21:53:30 +0100 Subject: [PATCH] a1 --- a1/program.c | 19 ++++++------------- a1/program.exe | Bin 66598 -> 66598 bytes a1/program.exe.stackdump | 9 ++++----- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/a1/program.c b/a1/program.c index 004c252..f9b6d94 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); - if (pole[0] == '\n') { //ci je riadok prazdny, ci sa stlacil enter + // Kontrola, či je riadok prázdny + if (pole[0] == '\n') { 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,19 +50,12 @@ int main(){ printf("CHYBA\n"); return 1; } - if (realny == vysledok){ - strcpy(vysledky[pocet], "OK"); //kopiruje vysledok do pola vysledky + printf ("OK\n"); } else{ - strcpy(vysledky[pocet], "ZLE"); + printf ("ZLE\n"); } - 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 c0b92d4373be59f3f508e2755c30861928982fcf..9d5cd001f098df3b67008f49e75d45f10a6b41c7 100644 GIT binary patch delta 3270 zcmai1YgAO%6+Y)OFP?XJ%z#GC;K-xV2tVViHq9Co(@7z11GyLgU>+Jn~ zdw*x&ea<~|*P6XsG<&ybYPSdKt(0cz0BUKj|q?#)G$jHcCSL^ZDkd<5~y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adLN;B9UFJsOtsRi+a0?90?%G#*#H0l diff --git a/a1/program.exe.stackdump b/a1/program.exe.stackdump index 55a2a6b..11d8648 100644 --- a/a1/program.exe.stackdump +++ b/a1/program.exe.stackdump @@ -1,15 +1,15 @@ -Exception: STATUS_ACCESS_VIOLATION at rip=000100401117 +Exception: STATUS_ACCESS_VIOLATION at rip=00010040110E rax=0000000000000000 rbx=0000000800021389 rcx=0000000000000000 rdx=0000000100403000 rsi=0000000000000000 rdi=0000000000000000 r8 =00000007FFFFCE98 r9 =0000000000000001 r10=0000000800000000 -r11=00000001004010F2 r12=0000000A00000370 r13=00000007FFFFCDF0 +r11=00000001004010E9 r12=0000000A00000370 r13=00000007FFFFCDF0 r14=0000000000000000 r15=0000000000000000 rbp=00000007FFFFCC40 rsp=00000007FFFFCB80 -program=C:\cygwin64\home\matus\a1\program.exe, pid 2113, thread main +program=C:\cygwin64\home\matus\a1\program.exe, pid 2327, thread main cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B Stack trace: Frame Function Args -0007FFFFCC40 000100401117 (000000000000, 000000000000, 000000000000, 000000000000) program.exe+0x1117 +0007FFFFCC40 00010040110E (000000000000, 000000000000, 000000000000, 000000000000) program.exe+0x110E 0007FFFFCD30 7FFF820C80A3 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x80A3 0007FFFFFFF0 7FFF820C5C86 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5C86 0007FFFFFFF0 7FFF820C5D34 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5D34 @@ -17,7 +17,6 @@ End of stack trace Loaded modules: 000100400000 program.exe 7FF812C10000 ntdll.dll -7FF804620000 aswhook.dll 7FF810960000 KERNEL32.DLL 7FF80FF50000 KERNELBASE.dll 7FFF820C0000 cygwin1.dll