⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 字符串递规问题.cpp

📁 这是一些c++例程
💻 CPP
字号:
// 字符串递规问题.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<stdlib.h>
#include<iostream.h>
#include<string.h>

#define SIZE 10 		/*临时数组的大小,其值一定要大于N */

void Full(char *p,int n,char *s,int m)
{
	if (n==0) 
	{
		s[m]='\0';
		cout<<s<<" ";
	}
	else
		for (int i=0;i < strlen(p);i++)
		{
			s[m]=p[i];
			Full(p,n-1,s,m+1);			//函数的递归调用
		}
}

void main()
{
	char s[SIZE];
	char *p="abc";
	int m=6;
	Full("abc",m,s,0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -