今天尝试使用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,虽然折腾了很长时间,不过终于成功了,比较高兴,呵呵