这里使用链栈的方式实现。
//main.cpp
#include <iostream>
#include <malloc.h>
#include <stdlib.h>
#include "LinkStack.h"
using namespace std;
int main()
{
char arr[50];
int arrLength = sizeof(arr) / sizeof(char);
int num = 0;
cout << "您要输入几个字符?:";
cin >> num;
cout << "\n\n请输入英文括号字符:";
cin >> arr;
cout << "\n\n当前输入的字符为:";
cout << arr;
bool Match_Brackets(char exp[], int n);
cout << "\n\n检查括号是否匹配的情况:";
Match_Brackets(arr, num);
system("pause");
cout << "\n";
return 0;
}
bool Match_Brackets(char exp[