From 71ce33da73f7523780654fb15b15013fea8e4e88 Mon Sep 17 00:00:00 2001 From: ak643du Date: Wed, 27 Mar 2024 14:52:02 +0100 Subject: [PATCH] Initialization# --- a1/program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index cdddc3f..47164a2 100644 --- a/a1/program.c +++ b/a1/program.c @@ -28,7 +28,7 @@ int main() { } // Parse the line - sscanf(line, "%lf%c%lf=%lf", &num1, &op, &num2, &expected_result); + sscanf(line, "%lf%c%lf=%.2lf", &num1, &op, &num2, &expected_result); // Check if the input is valid if (op != '+' && op != '-' && op != '*' && op != '/') {