From d40c9b81db3caff8ecca79df92241bc0c28a468c Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sun, 19 Feb 2017 22:28:52 +0700 Subject: Translate easy programs to Scheme --- others/volume1/006.scm | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 others/volume1/006.scm (limited to 'others/volume1/006.scm') diff --git a/others/volume1/006.scm b/others/volume1/006.scm new file mode 100644 index 0000000..f791de2 --- /dev/null +++ b/others/volume1/006.scm @@ -0,0 +1,8 @@ +(display ((lambda (str from to) + (let ((i (string-index str (string->char-set from)))) + (string-replace str to i (+ i (string-length from))))) + (number->string (let* ((a (read)) (b (read)) (c (read)) (d (read))) + (+ (/ a b) (/ c d)))) + "/" + " ")) +(newline) -- cgit 1.4.1