Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

用scheme算出来,再打表

Posted by ngn999 at 2008-07-16 18:48:58 on Problem 1517
(define (sum term next a b)
  (if (> a b)
      0
      (+ (term a)
         (sum term next (next a) b))))
;(sum (lambda (x) x) (lambda (x) (+ x 1)) 1 100)
(define (fac x)
  (if (= x 0)
      1
      (* x (fac (- x 1)))))

(define (do-sum x)
  (sum (lambda (x) (/ 1.0 (fac x))) (lambda (x) (+ x 1)) 0 x))
(map do-sum (list 0 1 2 3 4 5 6 7 8 9))

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator