submition9

This commit is contained in:
kr820js 2024-03-23 19:56:38 +01:00
parent 27d34610ae
commit be7ec2c186

View File

@ -76,7 +76,7 @@ int analizing_string(char* pointer){
int i = 0;
int counter=0;
while(pointer[i]!='\0'){
if(pointer[i]=='+'||pointer[i]=='/'||pointer[i]=='*'||pointer[i]=='-'){
if(pointer[i]=='+'||pointer[i]=='/'||pointer[i]=='*'){
operant=pointer[i];
counter++;
if(counter>1){
@ -158,14 +158,16 @@ int skip_spaces(int i, char *pointer) {
int copy_number(char number[], char *pointer, int i) {
int destination_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;
}
number[destination_i] = pointer[i];
destination_i++;
i++;
}
return i;
}