For example, if 6 is divided into the following 11 types, p (6) = 116; 5 + 1; 4 + 2, 4 + 1 + 1; 3 + 3, 3 + 2 + 1, 3 + 1 + 1 + 1; 2 + 2 + 2, 2 + 2 + 1 + 1, 2 + 1 + 1 + 1 + 1; 1 + 1 + 1 + 1 + 1 + 1; in all the partitions of positive integer n, the number of partitions with the maximum addition n1 not greater than m is recorded as q (n, m ). we can establish the following recursive relationship: (1) q (n, 1) = 1, n> = 1 The maximum addition number is not greater than 1, then there is only one division, n = 1 + 1 + 1 +... + 1 (2) q (n, m) = q (n, n), m> = n maximum addition n1 cannot be greater than n. therefore, q (1, m) = 1 (3) q (n, n) = 1 + q (n, n-1) the division of positive integer n includes the division of n1 = n and the division of n1 <n-1 (4) q (n, m) = q (m-1) + q (n-m, m), n> m> 1 the division of the maximum addition number n1 of positive integer n is not greater than m is composed of the division of n1 = m and the division of n1 <= M-1. calculate the recursion of q (n, m ). The function is as follows. obviously p (n) = q (n, n) int q (int n, int m) {if (n <1) | (m <1) return 0; if (n = 1) | (m = 1) return 1; if (n <m) returnq (n, n); if (n = m) return (q (m-1) + 1); if (n> m) return (q (n m-1) + q (n-m, m ));} in order to find all the divisions of n, we need to save the Division elements and output them in the process of finding the number of divisions of n. [cpp] # include <iostream> using namespace std; int q (int n, int m) {if (n <1 | m <1) return 0; if (n = 1 | m = 1) return 1; if (n <m) return q (n, n); if (n = m) return q (m-1) + 1; return q (m-1) + q (n-m, m); // return 0;} int main () {// cout <"!!! Hello World !!! "<Endl; // prints !!! Hello World !!! Cout <q (10, 10); return 0 ;}