submition9
This commit is contained in:
parent
27d34610ae
commit
be7ec2c186
@ -76,7 +76,7 @@ int analizing_string(char* pointer){
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int counter=0;
|
int counter=0;
|
||||||
while(pointer[i]!='\0'){
|
while(pointer[i]!='\0'){
|
||||||
if(pointer[i]=='+'||pointer[i]=='/'||pointer[i]=='*'||pointer[i]=='-'){
|
if(pointer[i]=='+'||pointer[i]=='/'||pointer[i]=='*'){
|
||||||
operant=pointer[i];
|
operant=pointer[i];
|
||||||
counter++;
|
counter++;
|
||||||
if(counter>1){
|
if(counter>1){
|
||||||
@ -158,14 +158,16 @@ int skip_spaces(int i, char *pointer) {
|
|||||||
int copy_number(char number[], char *pointer, int i) {
|
int copy_number(char number[], char *pointer, int i) {
|
||||||
int destination_i = 0;
|
int destination_i = 0;
|
||||||
while(pointer[i]!='\0'){
|
while(pointer[i]!='\0'){
|
||||||
if (!isdigit(pointer[i])&&pointer[i]!='.'&&pointer[i]!=',') {
|
if (!isdigit(pointer[i])&&pointer[i]!='.'&&pointer[i]!=','&&pointer[i]!='-') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (pointer[i] == '-' && destination_i > 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
number[destination_i] = pointer[i];
|
number[destination_i] = pointer[i];
|
||||||
destination_i++;
|
destination_i++;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user