代码:
#include
using namespace std;
char ch[27] = "aa…27个a,喵的打不出来";
void printword(int n, int m)
{
int i,j;
if (m == 0)
{
for (i = 0; i < n; i++)
cout << ch[i];
cout << endl;
}
else
{
for (ch[n-m]='a',j = 0; j < n; j++, ch[n - m]++)
printword(n, m - 1);
}
}
int main()
{
int n, m;
cin >> n;
m = n;
printword(n, m);
return 0;
}
这个代码看不懂,求一下代码的具体思路,我只知道是用了递归的思想,但具体怎么用看不懂