• + 1 comment

    Bases on your solutions and adding a bit of my own, I think this might be the shorstest way to solve this, using just the Prelude:

    main=interact$unlines.map (unwords.(map show)).flip take s.read
    s=[1]:map ((1:).(++[1]).(zipWith (+)=<<tail)) s