Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (ribs ) ;
- (define in (open-input-file "matrix.txt")) ;
- (define (iter lst i)
- (define line (read-line in)) ; Нумерация вершин с 1!!!
- (if (equal? line eof) lst
- (iter (append (help (string->list line) i 1 '()) lst) (+ i 1))))
- (iter '() 1))
- (define (help lst Nstr i result)
- (cond
- ( (equal? #\return (car lst)) result)
- ( (> i Nstr) result)
- ( (equal? (car lst) #\1) (help (cdr lst) Nstr (+ i 1) (cons (cons Nstr i) result)))
- ( (equal? #\space (car lst)) (help (cdr lst) Nstr i result))
- (else (help (cdr lst) Nstr (+ i 1) result))))
Add Comment
Please, Sign In to add comment