Aktualizovat „a1/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-03-15 17:38:58 +00:00
parent a3224fc972
commit 028aeecd5f

View File

@ -4,11 +4,11 @@
int main() int main()
{ {
double x=0; double x=0;
long double value =0; double value =0;
int count =0; int count =0;
long double arr[50]; double arr[50];
scanf("%lf",&x); scanf("%lf",&x);
while(scanf("%Lf",&value)!=EOF){ while(scanf("%lf",&value)!=EOF){
if(isalpha(value)!=0){ if(isalpha(value)!=0){
return 0; return 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-1;i++){
value+=arr[i]*pow(x,count-1-i); value+=arr[i]*pow(x,count-1-i);
} }