Scheme 和 ZOJ

来源:互联网 发布:手机字体颜色软件 编辑:程序博客网 时间:2024/05/22 13:26

  今天尝试使用Scheme来解决ZOJ上的问题,花费了好些时间才通过1001的测试,记下来做个纪念微笑

  

(define is-loop #t)(define (print)   (let ((x (read)) (y (read)))    (if      (and (not (eof-object? x))          (not (eof-object? y)))     (display (+ x y))     (set! is-loop #f)))  (if (and is-loop)      ((newline) (print))      (exit 0)))(begin  (print)  (exit 0))
本地使用的环境是DrRacket,虽然折腾了很长时间,不过终于成功了,比较高兴,呵呵

原创粉丝点击