30 lines
544 B
C
30 lines
544 B
C
#include <stdio.h>
|
|
#include<ctype.h>
|
|
#include<math.h>
|
|
int main()
|
|
{
|
|
double x=0;
|
|
long double value =0;
|
|
int count =0;
|
|
double arr[50];
|
|
scanf("%lf",&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;
|
|
} |