Aktualizovat „a1/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-03-14 21:21:18 +00:00
parent 0a3ac9c5a6
commit 00eed37fdf

View File

@ -3,11 +3,11 @@
#include<math.h> #include<math.h>
int main() int main()
{ {
double x=0; float x=0;
double value =0; float value =0;
int count =0; int count =0;
double arr[50]; float arr[50];
while(scanf("%lF",&value)!=EOF){ while(scanf("%f",&value)!=EOF){
if(isalpha(value)!=0){ if(isalpha(value)!=0){
return 0; return 0;
} }
@ -23,7 +23,7 @@ int main()
for(int i =0;i<count-1;i++){ for(int i =0;i<count-1;i++){
value+=arr[i]*pow(x,count-2-i); value+=arr[i]*pow(x,count-2-i);
} }
printf("Vysledok je :%.2F\n",value); printf("Vysledok je :%.2f\n",value);
return 0; return 0;