Initialization
This commit is contained in:
parent
4d2fb827b0
commit
ab1ac589a8
@ -11,11 +11,18 @@ int main() {
|
||||
int length = 0;
|
||||
double result = 0.0;
|
||||
|
||||
while (count < SIZE) {
|
||||
if (scanf("%d", &input) != 1) {
|
||||
printf("Nepodarilo sa nacitat polynom na %d mieste.", count);
|
||||
break;
|
||||
while (count < SIZE)
|
||||
{
|
||||
if (input == '\n')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (scanf("%d", &input) != 1)
|
||||
{
|
||||
printf("Nepodarilo sa nacitat polynom na %d mieste.", count);
|
||||
return 0;
|
||||
}
|
||||
coefs[count] = input;
|
||||
count++;
|
||||
@ -25,8 +32,9 @@ int main() {
|
||||
|
||||
length = count;
|
||||
|
||||
for (int i = 1; i < length; i ++){
|
||||
result = result * x + coefs[i];
|
||||
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