Loading [MathJax]/extensions/tex2jax.js

2010年7月15日木曜日

Find the K'th element of a list

;; P03 (*) Find the K'th element of a list.
;; The first element in the list is number 1.
;; Example:
;; * (element-at '(a b c d e) 3)
;; C
#lang racket
(provide element-at)
(define (element-at lst n)
(list-ref lst (- n 1)))
view raw p03.ss hosted with ❤ by GitHub

0 件のコメント:

コメントを投稿