Изменил(а) на 'du3/program.c'
This commit is contained in:
parent
eaa2b1b58b
commit
d338ee0fd6
@ -6,7 +6,7 @@
|
||||
|
||||
int main(){
|
||||
char pol[SIZE];
|
||||
memset(pol,' ',SIZE);
|
||||
memset(pol,'\0',SIZE);
|
||||
pol[SIZE]='\0';
|
||||
|
||||
int ch=0;
|
||||
@ -17,8 +17,13 @@ int main(){
|
||||
pol[idx]=ch;
|
||||
}
|
||||
|
||||
int koef=0;
|
||||
for(int i=0;i<strlen(pol);i++)if(pol[i]=='\n')koef++;
|
||||
int koef=-1;
|
||||
|
||||
for(int i=0;i<strlen(pol);i++){
|
||||
if(pol[i]=='\n')continue;
|
||||
for(int i2=0; pol[i]!='\n';i++);
|
||||
koef++;
|
||||
}
|
||||
|
||||
float x=0;
|
||||
char *end = NULL;
|
||||
@ -38,7 +43,6 @@ int main(){
|
||||
num+=p*n;
|
||||
}
|
||||
|
||||
//num=34.577;
|
||||
num=round(num*100)/100;
|
||||
|
||||
printf("%.2f\n", num);
|
||||
|
Loading…
Reference in New Issue
Block a user