用Racket语言做A+B
发现北大的bailian OJ支持racket这样一种Lisp的方言,也是一门函数式的语言,稍稍学习了一点基础语法,先学读入数据和输出数据
#lang racket (define (x) (read-line (current-input-port))) (define p (string-split (x) " ")) (define p1 (string->number (first p))) (define p2 (string->number (second p))) (printf "~a\n" (+ p1 p2))