Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang scheme
- (define (functions)
- (define in (open-input-file "inputF.txt"))
- (define (iter i word)
- (define ch (read-char in))
- (if (equal? ch eof) i
- (cond
- ((equal? ch #\( ) (if (equal? word '(#\e #\n #\i #\f #\e #\d)) (iter (+ 1 i) '()) (iter i '())))
- ((or(equal? ch #\space) (equal? ch #\newline)) (iter i word))
- (else (iter i (cons ch word))))))
- (iter 0 '()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement