資料結構實驗之棧二 一般算術表示式轉換成字尾式

2021-07-26 19:37:44 字數 606 閱讀 6634

資料結構實驗之棧二:一般算術表示式轉換成字尾式

time limit: 1000ms memory limit: 65536kb

problem description

對於乙個基於二元運算子的算術表示式,轉換為對應的字尾式,並輸出之。

input

輸入乙個算術表示式,以『#』字元作為結束標誌。

output

輸出該表示式轉換所得到的字尾式。

example input

a*b+(c-d/e)*f#

example output

ab*cde/-f*+

#include 

#include

int yx(char c);

int main()

else

if(yx(c)>yx(a[x]))

x--;

}else

}else

else}}

}while(x)

printf("\n");

return

0; }

int yx(char c)

資料結構實驗之棧二 一般算術表示式轉換成字尾式

abc defg hb 資料結構實驗之棧二 一般算術表示式轉換成字尾式 time limit 1000msmemory limit 65536kb64bit io format lld llu submit status practice sdutoj 2132 description 對於乙個基於...

資料結構實驗之棧二 一般算術表示式轉換成字尾式

description 對於乙個基於二元運算子的算術表示式,轉換為對應的字尾式,並輸出之。input 輸入乙個算術表示式,以 字元作為結束標誌。output 輸出該表示式轉換所得到的字尾式。sample input a b c d e f sample output ab cde f include...

資料結構實驗之棧二 一般算術表示式轉換成字尾式

對於乙個基於二元運算子的算術表示式,轉換為對應的字尾式,並輸出之。輸入乙個算術表示式,以 字元作為結束標誌。輸出該表示式轉換所得到的字尾式。a b c d e f ab cde f 最近在看棧的內容,但對於這道題,沒有想法,看到網上的題解,才明白怎麼回事,思路就是,建立乙個棧,是數字就輸出,是運算子...