This commit is contained in:
Bohdan Kapliuk 2024-10-12 16:30:01 +03:00
parent 3eb18b6a4d
commit 9300c574c6

View File

@ -21,6 +21,10 @@ int main(){
return 0;
}
if(vstup[0] == '-' || vstup[0] == '+' || vstup[0] == '*' || vstup[0] == '/'){
if(counter < 2){
printf("not enough operands\n");
return 0;
}
if(vstup[0] == '-'){
mystack.values[counter-2] = mystack.values[counter-2] - mystack.values[counter-1];
mystack.values[counter-1] = 0;