Answer:
There can be infinetly many numbers including negative and positive number which add up to 31.
Example
31 -1 1
31 -2 2……
But if your question ask for sum of 3 positive integers which give 31, then you can compile following code in C++.
4.5m questions
5.9m answers