概述
#include<iostream>
#include<cstring>
#include<string>
#pragma warning(disable:4996)
using namespace std;
/****预定义****/
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
typedef struct StringType {
char *ch;
int length;
int* next;
};
/*****串的基本操作****/
void init_Str(StringType &t,const char *chars)
{
int i = 0; const char *c = chars;
for (; *c; ++i, ++c);
if (!i) { t.ch = NULL; t.length = 0; }
else {
if (!(t.ch = (char*)malloc((i + 1) * sizeof(char))))
exit(OVERFLOW);
strcpy(t.ch, chars);
t.length = i;
t.ch[t.length] = '