30 lines
563 B
C
30 lines
563 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]={0};
|
|
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&&count-1-i>=0;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;
|
|
} |