From 124f50dbfed57a48e984c8ace83859a5b9520b9a Mon Sep 17 00:00:00 2001 From: ak643du Date: Tue, 5 Mar 2024 11:46:20 +0100 Subject: [PATCH] Initialization --- cv3/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 860b66d..7541170 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -6,13 +6,13 @@ int main() { double coefs[SIZE] = {0.0}; double x = 0.0; - char input; + double input = 0.0; int count = 0; int length = 0; double result = 0.0; - while (count < SIZE && scanf("%c", &input) == 1) { - coefs[count] = input - '0'; + while (count < SIZE && scanf("%lf", &input) == 1) { + coefs[count] = input; count++; }