Initialization
This commit is contained in:
parent
1d489bff98
commit
a2b7fa9c8e
@ -12,7 +12,6 @@ int main() {
|
||||
|
||||
while (count < SIZE) {
|
||||
if (scanf("%lf", &input) != 1) {
|
||||
if (scanf("%c", &input) == 1) {
|
||||
if (count == 0){
|
||||
printf("Nepodarilo sa nacitat zaklad x\n");
|
||||
return 0;
|
||||
@ -21,21 +20,20 @@ int main() {
|
||||
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
coefs[count] = input;
|
||||
count++;
|
||||
|
||||
if (getchar() == '\n') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
x = coefs[0];
|
||||
length = count;
|
||||
|
||||
while (getchar() != '\n') {
|
||||
for (int i = 1; i < length; i ++){
|
||||
result = result * x + coefs[i];
|
||||
}
|
||||
}
|
||||
|
||||
printf("Vysledok je: %.2lf\n", result);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user