duplicate certain lines _A_ by 51b

-module(d).
-export([m/0]).
m()->f(io:get_line(''),1).
f(A,N)->B=g(N,A),S=io:get_line(''),S<z orelse io:format(S++if B->S;0<1->""end)<f(A,N+1).
g(N,S)->case io_lib:fread("~d",S)of{_,[X],R}->g(N,R)or(N==X);_->1<0end.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page