a1 - 2
This commit is contained in:
parent
b2a8ce914d
commit
8589cc953f
@ -4,11 +4,11 @@
|
|||||||
#define MAX_LEN 100
|
#define MAX_LEN 100
|
||||||
|
|
||||||
int isOpening(char c){
|
int isOpening(char c){
|
||||||
if (c == '(' || c == '[' || c == '{' || c == '<') return 1
|
if (c == '(' || c == '[' || c == '{' || c == '<') return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isClosing(char c){
|
int isClosing(char c){
|
||||||
if (c == ')' || c == ']' || c == '}' || c == '>') return 1
|
if (c == ')' || c == ']' || c == '}' || c == '>') return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char expectedCLosing(char c){
|
char expectedCLosing(char c){
|
||||||
@ -47,7 +47,7 @@ int main(){
|
|||||||
|
|
||||||
int len = strlen(code);
|
int len = strlen(code);
|
||||||
for (int i = 0; i < len; i++){
|
for (int i = 0; i < len; i++){
|
||||||
c = code[i];
|
char c = code[i];
|
||||||
|
|
||||||
if (isOpening(c)){
|
if (isOpening(c)){
|
||||||
if (top < MAX_LEN - 1){
|
if (top < MAX_LEN - 1){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user