Initialization
This commit is contained in:
parent
bff9910943
commit
c7ef54ba95
@ -1,5 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define SIZE 100
|
||||
|
||||
@ -11,19 +10,7 @@ int main() {
|
||||
int length = 0;
|
||||
double result = 0.0;
|
||||
|
||||
while (count < SIZE)
|
||||
{
|
||||
if (coefs[count] == '\n')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
else if (scanf("%d", &input) != 1)
|
||||
{
|
||||
printf("Nepodarilo sa nacitat polynom na %d mieste.", count);
|
||||
break;
|
||||
}
|
||||
while (count < SIZE && scanf("%lf", &input) == 1) {
|
||||
coefs[count] = input;
|
||||
count++;
|
||||
}
|
||||
@ -32,8 +19,7 @@ int main() {
|
||||
|
||||
length = count;
|
||||
|
||||
for (int i = 1; i < length; i ++)
|
||||
{
|
||||
for (int i = 1; i < length; i ++){
|
||||
result = result * x + coefs[i];
|
||||
}
|
||||
|
||||
@ -41,5 +27,3 @@ int main() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user