
let rec loop _ =
    let a, op, b = Scanf.scanf "%d %s %d " (fun a op b -> a, op, b) in
    if op <> "?" then (
        let res =
            match op with
            | "+" -> a + b
            | "-" -> a - b
            | "/" -> a / b
            | "*" -> a * b
            | _ -> raise Not_found in
        Printf.printf "%d\n" res;
        loop () )

let _ = loop ();
        
