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

📄 3-9.c

📁 数据结构用C语言实现
💻 C
字号:
#include "stdio.h"
#include <string.h>
#define   MAX_SIZE   100 
void insert (char *s,  char  *t,  int i)
{   
	char string[MAX_SIZE],  *temp = string;
	if  ( i < 0  &&  i > strlen (s) )  {
		printf ( "插入位置不正确!\n");
		exit (1);
	}
	if  (!strlen (s))
		strcpy (s,  t);
	else   if (strlen (t))  {
		strncpy (temp, s, i);
		strcat (temp, t) ;
		strcat (temp,  (s + i ));
		strcpy (s, temp );
	}
}
void main ()
{
	char s[]="Sit please.";
	char t[]="down ";
	insert(s,t,4);
}

⌨️ 快捷键说明

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