Aktualizovat „a1/program.c“
This commit is contained in:
parent
085d44f4be
commit
1f99198196
12
a1/program.c
12
a1/program.c
@ -6,18 +6,18 @@ int main()
|
||||
double x=0;
|
||||
long double value =0;
|
||||
int count =0;
|
||||
double arr[50]={0};
|
||||
long double arr[50]={0};
|
||||
scanf("%lf",&x);
|
||||
while(scanf("%Lf",&value)!=EOF){
|
||||
if(isalpha(value)!=0){
|
||||
return 0;
|
||||
}
|
||||
arr[count]=(double)value;
|
||||
//if(isalpha(value)!=0){
|
||||
// return 0;
|
||||
//}
|
||||
arr[count]=value;
|
||||
count++;
|
||||
}
|
||||
value=0;
|
||||
for(int i =0;i<count&&count-1-i>=0;i++){
|
||||
value+=arr[i]*pow(x,count-1-i);
|
||||
value+=(long double)(arr[i]*pow(x,count-1-i));
|
||||
}
|
||||
|
||||
if(value>=40000&&value<=1000000){
|
||||
|
Loading…
Reference in New Issue
Block a user