- 310 名前:デフォルトの名無しさん [2012/03/19(月) 08:02:33.27 ]
- ;;効率的かは分からないが
;;Gauche (define (cr ad sex) (letrec ((port (open-input-string (symbol->string ad))) (iter (lambda (sex) (let ((ch (read-char port))) (cond ((eof-object? ch) sex) ((char=? ch #\a) (iter (car sex)))))))) (iter sex))) ;;aかどうかを気にしないなら(length (symbol->string ad))でもいいと思う
|

|