diff --git a/cv3/program.c b/cv3/program.c index 4867019..ac5d39f 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -3,18 +3,21 @@ #define SIZE 10 int main() { - char coefs[SIZE] = {0} ; + char coefs[SIZE]; int x = 0; int input; int count = 0; - - while (input != EOF || input != '\n'){ - coefs[SIZE] = input; - count ++; + + while (count < SIZE && scanf("%d", &input) == 1) { + coefs[count] = input; + count++; } - printf("%d\n", coefs[SIZE]); - + printf("Coefficients: "); + for (int i = 0; i < count; i++) { + printf("%d ", coefs[i]); + } return 0; } +