From 8a4fdaf01b67d16da03ace53aa9801f52ab546da Mon Sep 17 00:00:00 2001 From: ak643du Date: Tue, 5 Mar 2024 11:38:40 +0100 Subject: [PATCH] Initialization --- cv3/program.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 98387b3..30f40e5 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -1,4 +1,5 @@ #include +#include #define SIZE 100 @@ -9,16 +10,15 @@ int main() { int count = 0; int length = 0; double result = 0.0; + double ivrt = 0; while (count < SIZE && scanf("%c", &input) == 1) { - if (input == 'x') { - printf("\n x input \n"); - break; - } - else { - coefs[count] = input - '0'; // Convert character to double - count++; + ivrt = atof(input); + if (ivrt == 0.00){ + printf("String \n"; } + coefs[count] = input; + count++; } x = coefs[0];