pvjc20/a1/program.c

30 lines
543 B
C

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