There are 40 ways to make sums of three distinct positive integers total 25. (1+2+22 is such a sum, but 1+12+12 and 1+2+3+19 are not.)
How many different ways can three distinct positive integers sum to 1000?
(In reply to
With a little help from awk by Federico Kereki)
I think that since the problem asks for sums of DISTINCT positive integers, your if statement should be "if (C>B) total++" instead, don't you?