Aktualizovat „a1/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-03-15 17:41:21 +00:00
parent 50643d1153
commit 92a0a16cd8

View File

@ -6,7 +6,7 @@ int main()
double x=0; double x=0;
double value =0; double value =0;
int count =0; int count =0;
double arr[50]; double arr[50]={0};
scanf("%lf",&x); scanf("%lf",&x);
while(scanf("%lf",&value)!=EOF){ while(scanf("%lf",&value)!=EOF){
if(isalpha(value)!=0){ if(isalpha(value)!=0){
@ -16,7 +16,7 @@ int main()
count++; count++;
} }
value=0; value=0;
for(int i =0;i<count;i++){ for(int i =0;i<count&&count-1-i>=0;i++){
value+=arr[i]*pow(x,count-1-i); value+=arr[i]*pow(x,count-1-i);
} }