Swapping Two Items



One of the first things you learn in computer programming is how to exchange the values of two variables.   So this was of interest.

Mensa is an organization whose members have an IQ of 140 or higher.   A few years ago, there was a Mensa Convention in San Francisco and several members lunched at a local cafe.

While dining, they discovered that their salt shaker contained pepper and their pepper shaker was full of salt.   How could they swap the contents of the bottles without spilling and using only the implements at hand?   Clearly, this was a job for Mensa!

The group debated and presented ideas and finally came up with a brilliant solution involving a napkin, a straw and an empty saucer.   They called the waitress over to dazzle her with their solution.

"Ma'am," they said, "we couldn't help but notice that the pepper shaker contains salt and the salt shaker..."

"Oh," the waitress interrupted. "Sorry about that."

She unscrewed the caps of both bottles and switched them.