pvjc20/a1/program.c

30 lines
529 B
C

#include <stdio.h>
#include<ctype.h>
#include<math.h>
int main()
{
double x=0;
double value =0;
int count =0;
double arr[50];
while(scanf("%lF",&value)!=EOF){
if(isalpha(value)!=0){
return 0;
}
if(count !=0){
arr[count-1]=value;
}
else{
x=value;
}
count++;
}
value=0;
for(int i =0;i<count-1;i++){
value+=arr[i]*pow(x,count-2-i);
}
printf("Vysledok je :%.2F\n",value);
return 0;
}