Answer: D. To show how Twain was deliberately made to feel unwelcome.
An idiom is a phrase that has a figurative meaning, in addition to its literal meaning. Twain describes his meeting with the mates and clerks by saying that he got the "cold shoulder." This is an idiom that describes being ignored, dismissed or disregarded. Twain wants to tell us that the people he talked to made him feel unwelcome.