about summary refs log tree commit diff
path: root/others/mHoang/triangle.scm
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-19 22:28:52 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-19 22:28:52 +0700
commitd40c9b81db3caff8ecca79df92241bc0c28a468c (patch)
tree41985e48e9da1fbfb65af8105bfa0304744320bd /others/mHoang/triangle.scm
parenta53c4128c29f98b5fdfd9b0e13a3bbe094d975ec (diff)
downloadcp-d40c9b81db3caff8ecca79df92241bc0c28a468c.tar.gz
Translate easy programs to Scheme
Diffstat (limited to 'others/mHoang/triangle.scm')
-rw-r--r--others/mHoang/triangle.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/others/mHoang/triangle.scm b/others/mHoang/triangle.scm
new file mode 100644
index 0000000..33a154b
--- /dev/null
+++ b/others/mHoang/triangle.scm
@@ -0,0 +1,5 @@
+(define (angel-90 a b c)
+  ((lambda (x) (if (= x 0) 0 (/ x (abs x)))) (+ (* a a) (* b b) (- (* c c)))))
+(display (let ((a (read)) (b (read)) (c (read)))
+           (modulo (* (angel-90 a b c) (angel-90 b c a) (angel-90 c a b)) 3)))
+(newline)