03/11/14 15:17 4meSYN3s
>>131のソース
if(GetPriorityOperator(stack[stack_pos]) >= GetPriorityOperator(str[i])){
newstr.str[newstr_pos++] = stack[stack_pos--];
newstr.str[newstr_pos++] = ' ';
}else if(GetPriorityOperator(stack[stack_pos]) < GetPriorityOperator(str[i])){
stack[++stack_pos] = str[i];
break;
}
プライオリティが等しいときも演算子スタックにつまなきゃだめじゃない?
上記だと計算結果はあうけど逆ポーランド法表記的にまずくない?