Utility method to sort a , b , c ; after this method a <= b <= c
void order ( int & a , int & b , int & c ) { int copy [ 3 ] ; copy [ 0 ] = a ; copy [ 1 ] = b ; copy [ 2 ] = c ; sort ( copy , copy + 3 ) ; a = copy [ 0 ] ; b = copy [ 1 ] ; c = copy [ 2 ] ; }