forked from Orchid/orchid
Transfer commit
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import prelude::*
|
||||
import std::conv::(parse_float, to_string)
|
||||
import std::cpsio::(readline, print)
|
||||
import std::str::(concatenate)
|
||||
@@ -10,10 +11,10 @@ export main := do{
|
||||
cps data = readline;
|
||||
let b = parse_float data;
|
||||
let result = (
|
||||
if op = "+" then a + b
|
||||
else if op = "-" then a - b
|
||||
else if op = "*" then a * b
|
||||
else if op = "/" then a / b
|
||||
if op == "+" then a + b
|
||||
else if op == "-" then a - b
|
||||
else if op == "*" then a * b
|
||||
else if op == "/" then a / b
|
||||
else "Unsupported operation" -- dynamically typed shenanigans
|
||||
);
|
||||
cps print (to_string result ++ "\n");
|
||||
|
||||
Reference in New Issue
Block a user