This commit is contained in:
Weber 2024-03-28 18:27:47 +00:00
parent 91ea4221a9
commit ff00ea7f21

View File

@ -18,14 +18,14 @@ int main() {
} }
} }
if (isEmpty) { if (isEmpty) {
printf("OK\n");
continue; continue;
} }
int cislo1, cislo2; double cislo1, cislo2, vysledok_zadany;
double vysledok_zadany;
char operacia; 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"); printf("CHYBA\n");
continue; continue;
} }
@ -47,7 +47,7 @@ int main() {
printf("ZLE\n"); printf("ZLE\n");
continue; continue;
} }
vysledok_skutocny = (double)cislo1 / cislo2; vysledok_skutocny = cislo1 / cislo2;
break; break;
default: default:
printf("CHYBA\n"); printf("CHYBA\n");