uprava outputu

This commit is contained in:
Valér Jakubčo 2021-10-21 22:21:32 +02:00
parent 9786b86b3f
commit 364b136792

View File

@ -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]);
}
}