#45172: 如同AP325的eval( )


study (每天刷題要變強阿)

School : No School
ID : 237904
IP address : [203.69.90.37]
Last Login :
2025-02-14 19:18:18
f640. 函數運算式求值 -- APCS201902程式實作題3 | From: [111.242.94.253] | Post Date : 2025-01-20 12:18

int eval( ) {

           string s;

          

           如果是數字 return stoi(s);

           如果是f g h return 相對應的eval( ) //例如 2*eval( )-1

          最後 cout<<eval( )<<"\n";

}

 
ZeroJudge Forum