Find all solutions of the expression, where the sum of n variables equal an integer m. Variables and m are non-negative integers. $$ \sum_{i = 1}^nx_i = m,\ x_i>=0,\ m >=0,\ x_i\in W,\ m \in W $$
OR
$$ x_1 + x_2 + ...+x_n = m,\ x_1,x_2,..,x_n >= 0,\ m >= 0,\ x_i\in W,\ m \in W $$
I have the expression. I know how to find count of solutions, we can use the Combinations with Repetition: 
$$ C^m_{(n)} = \frac{(n+m-1)!}{m!(n-1)!} $$
But I don't really know how can I get all solutions. I have to create a program that prints all solutions, but I can't find the algorithm. May be math will help me. Sorry for english.
 A: I don't know how to create a program but I can help you how to interpret it algebraically.
Now, the value of each variable is integer which lies between $[0, m]$. This is same as distribution of $m$ identical objects to $n$ persons. Here, the identical objects are $m$ $1$'s and persons are the $n$ different variables.
Consider $n$ brackets corresponding to $n$ persons. In each bracket, take an expression given by $(1+x+x^2+\dots+x^m)$. Here, the various powers of $x$ viz: $0,1, 2,\dots,m$ correspond to the number of items each person can have in the distribution.
Since the total number of items is $m$. So, the required number of ways is the coefficient of $x^m$ in the product $$\underbrace{(x^0+x^1 +x^2+...+x^m)(x^0+x^1+x^2+...+x^m)\dots(x^0+x^1+x^2+...+x^m)}_{n-brackets}$$
Thus the required no. of ways are
$\begin{align}
\text{Coeff. of}\;x^m\;\text{in}\;(x^0+x^1+x^2+...+x^m)^n &=\text{Coeff. of}\;x^m\;\text{in}\;\left(\frac{1-x^{m+1}}{1-x}\right)^n\\
&=\text{Coeff. of}\;x^m\;\text{in}\;(1-x^{m+1})^n(1-x)^{-n}\\
&=\text{Coeff. of}\;x^m\;\text{in}\;(1-x)^{-n}\\
&={n+m-1\choose n-1}
\end{align}$
