Aktualizovat „a1/program.c“
This commit is contained in:
parent
314c336ded
commit
7d616ee905
16
a1/program.c
16
a1/program.c
@ -3,12 +3,12 @@
|
|||||||
#include<math.h>
|
#include<math.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
float x=0;
|
double x=0;
|
||||||
double value =0;
|
long double value =0;
|
||||||
int count =0;
|
int count =0;
|
||||||
double arr[50];
|
double arr[50];
|
||||||
scanf("%f",&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;
|
||||||
}
|
}
|
||||||
@ -20,10 +20,10 @@ int main()
|
|||||||
value+=arr[i]*pow(x,count-1-i);
|
value+=arr[i]*pow(x,count-1-i);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(value>=40000){
|
if(value>=40000){
|
||||||
// value =((int)(value*100 - 0.5)/100.00);
|
value =((int)(value*100 - 0.5)/100.00);
|
||||||
// }
|
}
|
||||||
printf("Vysledok je :%.2lf\n",value);
|
printf("Vysledok je :%Lf\n",value);
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user