uprava outputu
This commit is contained in:
parent
9786b86b3f
commit
364b136792
@ -42,7 +42,7 @@ int main(){
|
||||
if(char_value[0] == '-'){
|
||||
float a = pop_stack(&myStack);
|
||||
float b = pop_stack(&myStack);
|
||||
float c = a-b;
|
||||
float c = b-a;
|
||||
push_stack(&myStack, c);
|
||||
print_stack(&myStack);
|
||||
printf("\n");
|
||||
@ -70,6 +70,7 @@ int main(){
|
||||
printf("\n");
|
||||
}
|
||||
}else{
|
||||
puts("no input");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -79,9 +80,8 @@ int main(){
|
||||
}
|
||||
|
||||
void print_stack(struct stack* stack){
|
||||
printf(">");
|
||||
for(int i = 0; i < stack->size; i++){
|
||||
printf(" %f ",stack->values[i]);
|
||||
printf("%.2f ",stack->values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user