Aktualizovat „a1/program.c“
This commit is contained in:
parent
a09e2f68c5
commit
30ccb3261e
58
a1/program.c
58
a1/program.c
@ -1,30 +1,30 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include<ctype.h>
|
#include<ctype.h>
|
||||||
#include<math.h>
|
#include<math.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
float x=0;
|
float x=0;
|
||||||
float value =0;
|
float value =0;
|
||||||
int count =0;
|
int count =0;
|
||||||
float arr[50];
|
float arr[50];
|
||||||
while(scanf("%f",&value)!=EOF){
|
while(scanf("%f",&value)!=EOF){
|
||||||
if(isalpha(value)!=0){
|
if(isalpha(value)!=0){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(count !=0){
|
if(count !=0){
|
||||||
arr[count-1]=value;
|
arr[count-1]=value;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
x=value;
|
x=value;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
value=0;
|
value=0;
|
||||||
for(int i =0;i<count;i++){
|
for(int i =0;i<count-1;i++){
|
||||||
value+=arr[count]*pow(x,count-i);
|
value+=arr[count]*pow(x,count-2-i);
|
||||||
}
|
}
|
||||||
printf("Vysledok je :%f\n",value);
|
printf("Vysledok je :%f\n",value);
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user