I decided to review the ridiculous JulianR answer above.
The code is shorter, but perhaps more complex:
public static int Delta(int a, int b) { int delta = 0; while (a < b) { ++a; ++delta; } while (b < a) { ++b; ++delta; } return delta; }
(for the faint of heart ... this is no more serious than the strange question that started the topic)
abelenky Jul 11 '09 at 2:15 2009-07-11 02:15
source share