diff --git a/a1/program.c b/a1/program.c index 39e2a68..fac8f7d 100644 --- a/a1/program.c +++ b/a1/program.c @@ -18,14 +18,14 @@ int main() { } } if (isEmpty) { + printf("OK\n"); continue; } - int cislo1, cislo2; - double vysledok_zadany; + double cislo1, cislo2, vysledok_zadany; char operacia; - if (sscanf(uloha, "%d %c %d = %lf", &cislo1, &operacia, &cislo2, &vysledok_zadany) != 4) { + if (sscanf(uloha, "%lf %c %lf = %lf", &cislo1, &operacia, &cislo2, &vysledok_zadany) != 4) { printf("CHYBA\n"); continue; } @@ -47,7 +47,7 @@ int main() { printf("ZLE\n"); continue; } - vysledok_skutocny = (double)cislo1 / cislo2; + vysledok_skutocny = cislo1 / cislo2; break; default: printf("CHYBA\n");