From 016760ec5b46cd4f90b4616d0aba19da31e9d866 Mon Sep 17 00:00:00 2001 From: Weber Date: Thu, 28 Mar 2024 18:39:40 +0000 Subject: [PATCH] test --- a1/program.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/a1/program.c b/a1/program.c index 95b19ce..f895fb0 100644 --- a/a1/program.c +++ b/a1/program.c @@ -1,8 +1,7 @@ - #include #include #include -#include // Include string.h for strlen +#include #define MAX_LINE_LENGTH 100 @@ -46,7 +45,7 @@ int main() { break; case '/': if (cislo2 == 0) { - printf("ZLE\n"); + printf("CHYBA\n"); continue; } vysledok_skutocny = cislo1 / cislo2; @@ -56,6 +55,8 @@ int main() { continue; } + vysledok_skutocny = round(vysledok_skutocny * 100) / 100.0; + if (fabs(vysledok_skutocny - vysledok_zadany) < 1e-6) { printf("OK\n"); } else {