This commit is contained in:
Andrii Hermaniuk 2022-03-27 16:05:57 +02:00
parent 89877c5e8f
commit 5149b5b654

View File

@ -22,11 +22,11 @@ int main(){
char *start=priklad, *end=NULL; char *start=priklad, *end=NULL;
for(int c=0;c<count;c++){ for(int c=0;c<count;c++){
int skip=0,znak=0; int skip=0,z=0;
for(int idx=0;start[idx]!='\n';idx++){ for(int idx=0;start[idx]!='\n';idx++){
if(start[idx]=='+'||start[idx]=='-'||start[idx]=='*'||start[idx]=='/'){ if(start[idx]=='+'||start[idx]=='-'||start[idx]=='*'||start[idx]=='/'){
znak=1; z=1;
} }
if((start[idx]<'0'||start[idx]>'9')&&start[idx]!=' '&&start[idx]!='='&&start[idx]!='+'&&start[idx]!='-'&&start[idx]!='*'&&start[idx]!='/'&&start[idx]!='.'){ if((start[idx]<'0'||start[idx]>'9')&&start[idx]!=' '&&start[idx]!='='&&start[idx]!='+'&&start[idx]!='-'&&start[idx]!='*'&&start[idx]!='/'&&start[idx]!='.'){
skip=1; skip=1;
@ -36,7 +36,7 @@ for(int c=0;c<count;c++){
break; break;
} }
} }
if(skip==1||znak==0){ if(skip==1||z==0){
continue; continue;
} }
float num1=strtof(start,&end); float num1=strtof(start,&end);