Code Review
Compare your solutions
#| BEGIN (Введите свое решение) |#
(define (solution b n)
(define (square x)
(* x x))
(define (fast-expt-iter a b n)
(cond ((= n 0) a)
((even? n) (fast-expt-iter a (square b) (/ n 2)))
(else (fast-expt-iter (* a b) b (- n 1)))))
(fast-expt-iter 1 b n))
#| END |#
#| BEGIN (Введите свое решение) |#
(define (solution b n)
(define (square x)
(* x x))
(define (fast-expt-iter a b n)
(cond ((= n 0) a)
((even? n) (fast-expt-iter a (square b) (/ n 2)))
(else (fast-expt-iter (* a b) b (- n 1)))))
(fast-expt-iter 1 b n))
#| END |#
#| BEGIN (Введите свое решение) |#
(define (solution b n)
(define (square x)
(* x x))
(define (fast-expt-iter a b n)
(cond ((= n 0) a)
((even? n) (fast-expt-iter a (square b) (/ n 2)))
(else (fast-expt-iter (* a b) b (- n 1)))))
(fast-expt-iter 1 b n))
#| END |#
#| BEGIN (Введите свое решение) |#
(define (solution b n)
(define (square x)
(* x x))
(define (fast-expt-iter a b n)
(cond ((= n 0) a)
((even? n) (fast-expt-iter a (square b) (/ n 2)))
(else (fast-expt-iter (* a b) b (- n 1)))))
(fast-expt-iter 1 b n))
#| END |#