Aktualizovat „a1/program.c“

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

View File

@ -3,11 +3,11 @@
#include<math.h> #include<math.h>
int main() int main()
{ {
float x=0; double x=0;
float value =0; double value =0;
int count =0; int count =0;
float arr[50]; double arr[50];
while(scanf("%f",&value)!=EOF){ while(scanf("%lF",&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;