This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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))) |
0 件のコメント:
コメントを投稿