Analysis: If there are X people, everyone will shake hands with (X- 1) people except themselves, so the total number of handshakes is X(X- 1), but among these X(X- 1) handshakes, A and B handshakes are actually counted as one time, so half of the handshakes are repeated.
In addition, a similar problem is the gift of greeting cards, that is, if n people send cards to each other, there will always be N(N- 1) cards. The derivation process is similar to the above, except that both need to be sent, so there is no need to divide by 2 in the end.