Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (good?)
- (define in (open-input-file "peaks.txt"))
- (define numberofpeaks (function (string->list(read-line in)) 0 0))
- (define (iter)
- (define line (read-line in))
- (if (equal? line eof) true
- (if (=(function (string->list line) 0 0) (- numberofpeaks 1)) (iter) false)))
- (iter))
- (define (function lst number degree) ;функция выделяет первое число в строке
- (if (or (equal? #\space (car lst)) (equal? #\return (car lst))) number
- (function (cdr lst) (+ number (*(- (char->integer (car lst)) 48) (expt 10 degree))) (+ 1 degree))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement