Initialization
This commit is contained in:
parent
6daf21a50d
commit
4d2fb827b0
@ -11,7 +11,12 @@ int main() {
|
||||
int length = 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;
|
||||
count++;
|
||||
}
|
||||
@ -20,19 +25,6 @@ int main() {
|
||||
|
||||
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 ++){
|
||||
result = result * x + coefs[i];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user