Input: (+ 5 (- 8 3)) Sample Output: 10 Sample Input: (+ (* (- 9 4) 8) (- 8 3)) Sample Output: 45 Sample Input: (* (- 9 20) (+ 7 (- 999 108)) ) Sample Output: -9878 できたら、
[email protected] まで送付お願いします。 実行イメージ # cat input.txt (- 8 3) # cat input.txt | ruby a.rb 5 標準入力はRubyなら STDIN.gets.chomp などで拾えます。 (STDIN.getsは改行コードが 入ってしまうためchompが必要)