What is a protocol for determining which of two numbers is larger, without sharing those numbers?
As pointed out by Luke Mathieson in the comments, this problem is called Yao's Millionaire Problem, for which protocols can easily be found by Googling.