From 76343f40d7799472975fa3dba6edc2fa0d4219be Mon Sep 17 00:00:00 2001 From: Miloslav Macko Date: Fri, 22 Mar 2024 12:57:45 +0100 Subject: [PATCH] 22.3 --- a1/program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index 115abc7..01c48c6 100644 --- a/a1/program.c +++ b/a1/program.c @@ -49,7 +49,7 @@ int main() { char op; double num1, num2, result; - int scanned = sscanf(line, "%lf %c %lf = %lf", &num1, &op, &num2, &result); + int scanned = sscanf(line, "%lf%*[ ]%c%*[ ]%lf%*[ ]=%*[ ]%lf", &num1, &op, &num2, &result); // Kontrola, či boli načítané správne hodnoty if (scanned != 4 || !is_operator(op) || !is_digit(line[0]) || !is_digit(line[len-2]) || line[len-3] != ' ')