Chinaunix首页 | 论坛 | 博客
  • 博客访问: 209642
  • 博文数量: 136
  • 博客积分: 2919
  • 博客等级: 少校
  • 技术积分: 1299
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-11 09:08
文章分类

全部博文(136)

文章存档

2013年(1)

2011年(135)

我的朋友

分类: LINUX

2011-12-05 08:46:09

  1. ;; mht created on Nov 9, 2011

  2. ;; equation1 : number -> boolean
  3. ;; to determine whether x is a solution for x^2+2*x+1=0
  4. (define (equation1 x)
  5.   (= (+ (* x x) (* 2 x) 1) 0))

  6. ; test
  7. (equation1 1)

  8. ;; equation2 : number -> boolean
  9. ;; to determine whether x is a solution for 4n+1=62
  10. (define (equation2 x)
  11.   (= (+ (* 4 x) 1) 62))

  12. (equation2 14)

  13. ;; equation3 : number -> boolean
  14. ;; to determine whether x is a solution for 2*n^2=102
  15. (define (equation3 x)
  16.   (= (* 2 (* x x)) 102))
  17. (equation3 14)

  18. ;; equation4 : number -> boolean
  19. ;; to determine whether x is a solution for 4*n^2+6n+2=462
  20. (define (equation4 x)
  21.   (= (+ (* 4 (* x x)) (* 6 x) 2) 462))
  22. (equation4 10)
阅读(278) | 评论(0) | 转发(0) |
0

上一篇:exam2.2.2

下一篇:exam2.2.4

给主人留下些什么吧!~~