Initialization

This commit is contained in:
Kozar 2024-03-04 19:52:12 +01:00
parent 6daf21a50d
commit 4d2fb827b0

View File

@ -11,7 +11,12 @@ int main() {
int length = 0; int length = 0;
double result = 0.0; double result = 0.0;
while (count < SIZE && scanf("%lf", &input) == 1) { while (count < SIZE) {
if (scanf("%d", &input) != 1) {
printf("Nepodarilo sa nacitat polynom na %d mieste.", count);
break;
}
coefs[count] = input; coefs[count] = input;
count++; count++;
} }
@ -20,19 +25,6 @@ int main() {
length = count; length = count;
// for (int y = 0; y < length; y++ ){
// int b = coefs[y];
// if (isdigit(b) == 0){
// printf("Nepodarilo sa nacitat polynom na %d mieste.", y);
// break;
// }
// else{
// continue;
// }
// }
for (int i = 1; i < length; i ++){ for (int i = 1; i < length; i ++){
result = result * x + coefs[i]; result = result * x + coefs[i];
} }