foreach o\ b [lassign [gets stdin] a] {set a [expr $a$o$b]};puts $a
-2 + 6 / 2 * 8 - 1 / 2.5 - 18
-12.0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!