//将n 分成k份的 分法总数 #include "stdafx.h" #include"stdio.h" #include<iostream> using namespace std; int f(int n,int k) { if (k == 2) return n / 2; else { int s = 0; for (int i = 1; i <= n / k; i++)//第一份初始值i s = s + f(n - (i - 1)*k -…
Description You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q. For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to th…