The most obviously moral/practical solution in my opinion would be to order the text used from Amazon and then read the pirated electronic version.
Disagree. The author gets not a single bent penny from second-hand sales. (Neither does the publisher.)
The best move is to grab the pirated electronic copy, then buy a new copy of the author's latest book. That way, they get paid and their publisher receives a price signal that this author is popular.
As an interesting side note for
Top Ten Things Overheard At The ANSI C Draft Committee Meetings: (5) All right, who's the wiseguy who stuck this trigraph stuff in here?