From 62fcb14125bd2d75671d95b930598ddc8c804a66 Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Wed, 20 Mar 2024 16:01:15 +0100 Subject: [PATCH] round fix --- a1/program.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/a1/program.c b/a1/program.c index eb730ea..bb8a12d 100644 --- a/a1/program.c +++ b/a1/program.c @@ -36,7 +36,9 @@ int main() { break; } - if (fabs(vysledok - ocakavany_vysledok) < 0.01) { + vysledok = roundf(vysledok * 100) / 100; + + if (vysledok == ocakavany_vysledok) { printf("OK\n"); } else { printf("ZLE\n"); @@ -53,4 +55,3 @@ int main() { return 0; } -