replace last occurrence FIXED by koyama41

m@main=getLine>>=putStrLn.last.f.words>>m
f[a,b,c]=c:[w++b++z|(w,x)<-s c,(y,z)<-s x,y==a]
s x=map(`splitAt`x)[0..999]

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

download

return to the top page