pvjc20/a1/program.c

30 lines
531 B
C

#include <stdio.h>
#include<ctype.h>
#include<math.h>
int main()
{
float x=0;
float value =0;
int count =0;
float arr[50];
scanf("%f",&x);
while(scanf("%f",&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-i);
}
if(value>=40000){
value =((int)(value*100 - 0.5)/100.00);
}
printf("Vysledok je :%.2f\n",value);
return 0;
}