criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#include <string.h>

int main() {
	int i, j;
	char t[101], c, st[101];
	while (true) {
		for (i = 0; ~scanf("%c", &c) && c != '\n'; i++) {
			t[i] = c;
		}
		t[i] = 0;
		if (t[0] == '.' && t[1] == 0) {
			return 0;
		} 
		memset(st, 0, sizeof st);
		for (i = 0, j = 0; i <= strlen(t); i++) {
			if (t[i] == '(' || t[i] == '[') {
				st[j++] = t[i];
			}
			if (t[i] == ')') {
				if (st[--j] != '(') {
					puts("no");
					break;
				}
			}
			if (t[i] == ']') {
				if (st[--j] != '[') {
					puts("no");
					break;
				}
			}
			if (t[i] == 0) {
				puts("yes");
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:16: error: 'true' undeclared (first use in this function)
    7 |         while (true) {
      |                ^~~~
main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <string.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:7:16: note: each undeclared identifier is reported only once for each function it appears in
    7 |         while (true) {
      |                ^~~~
Language: C

#include <stdio.h>
#include <string.h>

int main(void) {
	int i, j;
	char t[101], c, st[101];
	while (true) {
		for (i = 0; ~scanf("%c", &c) && c != '\n'; i++) {
			t[i] = c;
		}
		t[i] = 0;
		if (t[0] == '.' && t[1] == 0) {
			return 0;
		} 
		memset(st, 0, sizeof st);
		for (i = 0, j = 0; i <= strlen(t); i++) {
			if (t[i] == '(' || t[i] == '[') {
				st[j++] = t[i];
			}
			if (t[i] == ')') {
				if (st[--j] != '(') {
					puts("no");
					break;
				}
			}
			if (t[i] == ']') {
				if (st[--j] != '[') {
					puts("no");
					break;
				}
			}
			if (t[i] == 0) {
				puts("yes");
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:16: error: 'true' undeclared (first use in this function)
    7 |         while (true) {
      |                ^~~~
main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <string.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:7:16: note: each undeclared identifier is reported only once for each function it appears in
    7 |         while (true) {
      |                ^~~~
Language: C

#include<stdio.h>
#include<stdlib.h>

int main() {

	char c[101];
	char s[101];
	int i,j;

	for(;;) {
		gets(c);
		if(c[0]=='.') break;

		j=0;
		for(i=0;i<100;i++) {
			if(c[i]=='.') break;

			switch (c[i]) {
			
			case '(':
				s[j]=c[i];
				j++;
				break;
				
			case ')':
				if(j>0&&s[j-1]=='(') {
					s[j-1]='\0';
					j--;
				}
				break;
				
			case '[':
				s[j]=c[i];
				j++;
				break;
				
			case']':
				if(j>0&&s[j-1]=='[') {
					s[j-1]='\0';
					j--;
				}
				break;
			}
		}
		if(j>0)
			printf("no\n");
		else
			printf("yes\n");
	}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   11 |                 gets(c);
      |                 ^~~~
      |                 fgets
main.c:49:9: error: expected declaration or statement at end of input
   49 |         }
      |         ^
Language: C

#include <studio.h>
#include <string.h>
int f;
char s[101];
void judge(int n,,char c){
int i;
for(i=n+1;s[i]!='\0';i++){
if(c=='('){
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(s[i]==']')
f=0;
if(s[i]==')')
break;
}
else if(c=='['){
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(s[i]==')')
f=0;
if(s[i]==']')
break;
}
}
}
int main(void){
while(1){
f=1;
fgets(s,101,stdin);
s[strlen(s)]='\0';
if(s[0]=='.'&&strlen(s)==1)
break;
int i;
for(i=0;s[i];i++)
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(f)
puts("yes");
else
puts("no");
}
return 0;
}

Compiler output:
main.c:1:10: fatal error: studio.h: No such file or directory
    1 | #include <studio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <string.h>
int f;
char s[101];
void judge(int n,,char c){
int i;
for(i=n+1;s[i]!='\0';i++){
if(c=='('){
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(s[i]==']')
f=0;
if(s[i]==')')
break;
}
else if(c=='['){
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(s[i]==')')
f=0;
if(s[i]==']')
break;
}
}
}
int main(void){
while(1){
f=1;
fgets(s,101,stdin);
s[strlen(s)]='\0';
if(s[0]=='.'&&strlen(s)==1)
break;
int i;
for(i=0;s[i];i++)
if(s[i]=='('||s[i]=='[')
judge(i,s[i]);
if(f)
puts("yes");
else
puts("no");
}
return 0;
}

Compiler output:
main.c:5:18: error: expected declaration specifiers or '...' before ',' token
    5 | void judge(int n,,char c){
      |                  ^
main.c: In function 'main':
main.c:36:1: error: implicit declaration of function 'judge' [-Wimplicit-function-declaration]
   36 | judge(i,s[i]);
      | ^~~~~
Language: C

import java.util.Scanner;

public class Main {
    public static void main(String[] args)  {
       Scanner sc = new Scanner(System.in);
       int flag=0;
       while(sc.hasNext()){
           int no=0;
           int count=0;
           int kind=0;
           for(char a = sc.nextchar(); a!='.'  && sc.hasNext() && no==0 ; a = sc.nextchar()){
                if(a=='('){
                    count+=1;
                    kind=1;
                }
                if(a=='['){
                    count+=2;
                    kind=2;
                }
                
                if(a==')'){
                    if(kind==1) count-=1;
                    else {
                        System.out.println("no");
                        no=1;
                    }
                }
                if(a==']'){
                    if(kind==2) count-=2;
                    else {
                        System.out.println("no");
                        no=1;
                    } 
                }
                
                if(count==0) System.out.println("yes");
                else System.out.println("no");
           }
           
       }
    }
}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class Main {
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    3 | public class Main {
      |              ^~~~
Language: C

import java.util.*;
import java.util.Scanner;

public class Main {
    public static void main(String[] args)  {
       Scanner sc = new Scanner(System.in);
       int flag=0;
       while(sc.hasNext()){
           String str = sc.next();
           char [] A = str.toCharArray;
           int no=0;
           int count=0;
           int kind=0;
           for(int i=0; A[i]!='.' && no==0 ;i++){
                if(A[i]=='('){
                    count+=1;
                    kind=1;
                }
                if(A[i]=='['){
                    count+=2;
                    kind=2;
                }
                
                if(A[i]==')'){
                    if(kind==1) count-=1;
                    else {
                        System.out.println("no");
                        no=1;
                    }
                }
                if(A[i]==']'){
                    if(kind==2) count-=2;
                    else {
                        System.out.println("no");
                        no=1;
                    } 
                }
                
                if(count==0) System.out.println("yes");
                else System.out.println("no");
           }
           
       }
    }
}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Scanner;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

import java.util.*;


public class Main {
    public static void main(String[] args)  {
       Scanner sc = new Scanner(System.in);
       int flag=0;
       while(sc.hasNext()){
           String str = sc.next();
           char [] A = str.toCharArray;
           int no=0;
           int count=0;
           int kind=0;
           for(int i=0; A[i]!='.' && no==0 ;i++){
                if(A[i]=='('){
                    count+=1;
                    kind=1;
                }
                if(A[i]=='['){
                    count+=2;
                    kind=2;
                }
                
                if(A[i]==')'){
                    if(kind==1) count-=1;
                    else {
                        System.out.println("no");
                        no=1;
                    }
                }
                if(A[i]==']'){
                    if(kind==2) count-=2;
                    else {
                        System.out.println("no");
                        no=1;
                    } 
                }
                
                if(count==0) System.out.println("yes");
                else System.out.println("no");
           }
           
       }
    }
}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

import java.util.Scanner;


public class Main {
    public static void main(String[] args)  {
       Scanner sc = new Scanner(System.in);
       int flag=0;
       while(sc.hasNext()){
           String str = sc.next();
           char [] A = str.toCharArray;
           int no=0;
           int count=0;
           int kind=0;
           for(int i=0; A[i]!='.' && no==0 ;i++){
                if(A[i]=='('){
                    count+=1;
                    kind=1;
                }
                if(A[i]=='['){
                    count+=2;
                    kind=2;
                }
                
                if(A[i]==')'){
                    if(kind==1) count-=1;
                    else {
                        System.out.println("no");
                        no=1;
                    }
                }
                if(A[i]==']'){
                    if(kind==2) count-=2;
                    else {
                        System.out.println("no");
                        no=1;
                    } 
                }
                
                if(count==0) System.out.println("yes");
                else System.out.println("no");
           }
           
       }
    }
}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

import java.util.Scanner;


public class Main {
    public static void main(String[] args)  {
       Scanner sc = new Scanner(System.in);
       int flag=0;
       while(sc.hasNext()){
           String str = sc.next();
           char [] A =  str.toCharArray();
           int no=0;
           int count=0;
           int kind=0;
           for(int i=0; A[i]!='.' && no==0 ;i++){
                if(A[i]=='('){
                    count+=1;
                    kind=1;
                }
                if(A[i]=='['){
                    count+=2;
                    kind=2;
                }
                
                if(A[i]==')'){
                    if(kind==1) count-=1;
                    else {
                        System.out.println("no");
                        no=1;
                    }
                }
                if(A[i]==']'){
                    if(kind==2) count-=2;
                    else {
                        System.out.println("no");
                        no=1;
                    } 
                }
                
                if(count==0) System.out.println("yes");
                else System.out.println("no");
           }
           
       }
    }
}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

import java.util.Scanner;


public class Main {
    public static void main(String[] args) throws Exception   {
       Scanner sc = new Scanner(System.in);
       int flag=0;
       while(sc.hasNext()){
           String s = sc.next();
           char [] A =  s.toCharArray();
           int no=0;
           int count=0;
           int kind=0;
           for(int i=0; A[i]!='.' && no==0 ;i++){
                if(A[i]=='('){
                    count+=1;
                    kind=1;
                }
                if(A[i]=='['){
                    count+=2;
                    kind=2;
                }
                
                if(A[i]==')'){
                    if(kind==1) count-=1;
                    else {
                        System.out.println("no");
                        no=1;
                    }
                }
                if(A[i]==']'){
                    if(kind==2) count-=2;
                    else {
                        System.out.println("no");
                        no=1;
                    } 
                }
                
                if(count==0) System.out.println("yes");
                else System.out.println("no");
           }
           
       }
    }
}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

import java.util.Scanner;
import java.util.Stack;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine()){
			String s = sc.nextLine();
			
			Stack<Character> count = new Stack<>(); 
			boolean flag = true;
			LABEL:
				for(int i = 0; i < s.length(); i++) {
					char c = s.charAt(i);
					switch(c) {
					case '(':
						count.push(')');
						break;
					case '[':
						count.push(']');
						break;
					case ')':
					case ']':
						if(count.isEmpty() || count.pop() != c) {
							flag = false;
							break LABEL;
						}
					}
				}

					if(count.isEmpty() && flag) {
						System.out.println("yes");
					}
					else {
						System.out.println("no");
					}
				}
		}	
	}







Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Stack;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Stack;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

char S[999],v[999];
main(){
	int T,C,i;
	for(;gets(S),S[1];puts(T?"no":"yes")){
		for(T=C=i=0;i<strlen(S);i++)
		switch(S[i]){
			case '(': v[C++]=1;break;
			case '[': v[C++]=2;break;
			case ')': if(!C||v[--C]!=1)goto F;break;
			case ']': if(!C||v[--C]!=2)goto F;break;
		}
		if(!C)continue;
		F:T=1;
	}
exit(0);}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:14: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    4 |         for(;gets(S),S[1];puts(T?"no":"yes")){
      |              ^~~~
main.c:4:27: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    4 |         for(;gets(S),S[1];puts(T?"no":"yes")){
      |                           ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | char S[999],v[999];
main.c:5:31: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    5 |                 for(T=C=i=0;i<strlen(S);i++)
      |                               ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | char S[999],v[999];
main.c:5:31: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    5 |                 for(T=C=i=0;i<strlen(S);i++)
      |                               ^~~~~~
main.c:5:31: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:15:1: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   15 | exit(0);}
      | ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | char S[999],v[999];
main.c:15:1: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   15 | exit(0);}
      | ^~~~
main.c:15:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
Language: C

#include<iostream>
#include<string>
#include<stack>

using namespace std;

int main(void){
  string s;
  stack<char> str;

  while(getline(cin,s) && s!="."){

    string ch;
    for(int i=0;i<s.length;i++)
      if(s[i]=='{' || s[i]=='(' || s[i]=='}' || s[i]==')')ch+=s[i];

    for(int i=0;i<ch.length();i++){
      
      if(ch[i]=='(' || ch[i]=='{')str.push(s[i]);
      
      if(ch[i]==')' && str.top()=='(')str.pop();
      if(ch[i]=='}' && str.top()=='}')str.pop();
    }

    cout << str.empty()?"YES":"NO" << endl;

  }

  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

char stack[100];
int sp=0;

int main(int argc, char* argv[]){
	char a, prev='.';

	while(scanf("%c",&a)){
		if(a=='\n') continue;
		switch(a){
			case '(': stack[sp]='('; sp++; break;
			case '[': stack[sp]='['; sp++; break;
			case ')':
				if(stack[sp-1]=='(') sp--;
				else { while(a!='.') fscanf(file,"%c",&a); sp=0; printf("no\n"); }
				break;
			case ']':
				if(stack[sp-1]=='[') sp--;
				else { while(a!='.') fscanf(file,"%c",&a); sp=0; printf("no\n"); }
				break;
			case '.':
				if(prev=='.') return;
				if(sp==0) printf("yes\n"); else printf("no\n"), sp=0;
		}
		prev=a;
	}
}

Compiler output:
main.c: In function 'main':
main.c:16:61: error: 'file' undeclared (first use in this function); did you mean 'fileno'?
   16 |                                 else { while(a!='.') fscanf(file,"%c",&a); sp=0; printf("no\n"); }
      |                                                             ^~~~
      |                                                             fileno
main.c:16:61: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:47: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   23 |                                 if(prev=='.') return;
      |                                               ^~~~~~
main.c:6:5: note: declared here
    6 | int main(int argc, char* argv[]){
      |     ^~~~
Language: C

main(){
	char b[110],s[99]={0},*q,*p;
	while(fgets(b,110,stdin),*b!='.'){
		q=s+1;
		for(p=b;*p!='.';p++){
			if(*p=='('||*p=='['){
				*q++=*p;
			}
			if(*p==')'||*p==']'){
				q--;
				if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){
					puts("no");
					break;
				}
			}
		}
		if(*p=='.')puts(q-s-1?"no":"yes");
	}
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:15: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    3 |         while(fgets(b,110,stdin),*b!='.'){
      |               ^~~~~
main.c:3:27: error: 'stdin' undeclared (first use in this function)
    3 |         while(fgets(b,110,stdin),*b!='.'){
      |                           ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:3:27: note: each undeclared identifier is reported only once for each function it appears in
    3 |         while(fgets(b,110,stdin),*b!='.'){
      |                           ^~~~~
main.c:12:41: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   12 |                                         puts("no");
      |                                         ^~~~
main.c:12:41: note: include '<stdio.h>' or provide a declaration of 'puts'
Language: C

#include <stdio.h>
int main(){
	char b[110],s[110]={0},*q,*p;
	while(b=".",*b!='.'){
		q=s+1;
		for(p=b;*p!='.';p++){
			if(*p=='('||*p=='[') *q++=*p;
			if(*p==')'||*p==']'){
				q--;
				if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){
					puts("no");
					break;
				}
			}
		}
		if(*p=='.')puts(q==s+1?"yes":"no");
	}
}

Compiler output:
main.c: In function 'main':
main.c:4:16: error: assignment to expression with array type
    4 |         while(b=".",*b!='.'){
      |                ^
Language: C

b[110],s[110]={0};main(*q,*p){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | b[110],s[110]={0};main(*q,*p){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:1:8: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
    1 | b[110],s[110]={0};main(*q,*p){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      |        ^
main.c:1:24: error: expected declaration specifiers or '...' before '*' token
    1 | b[110],s[110]={0};main(*q,*p){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      |                        ^
main.c:1:27: error: expected declaration specifiers or '...' before '*' token
    1 | b[110],s[110]={0};main(*q,*p){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      |                           ^
Language: C

s[110]={0},*q,*p;main(b[110]){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s[110]={0},*q,*p;main(b[110]){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:13: error: type defaults to 'int' in declaration of 'q' [-Wimplicit-int]
    1 | s[110]={0},*q,*p;main(b[110]){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      |             ^
main.c:1:16: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
    1 | s[110]={0},*q,*p;main(b[110]){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      |                ^
main.c:1:23: error: unknown type name 'b'
    1 | s[110]={0},*q,*p;main(b[110]){while(scanf("%[^\n]%*c",b),*b-'.'){q=s+1;for(p=b;*p-'.';p++){if(*p=='('||*p=='[') *q++=*p;if(*p==')'||*p==']'){q--;if(!((*q=='('&&*p==')')||(*q=='['&&*p==']'))){puts("no");break;}}}if(*p=='.')puts(q-s-1?"no":"yes");}}
      |                       ^
Language: C

char s[110],a[110],b,i,t;
main(){
  while(gets(s),strcmp(s,".")){
    for(t=1,b=0,i=0;s[i]&&t;++i){
      if(s[i]==40||s[i]==91) a[b++]=s[i];
      else if(s[i]==41||s[i]==93) {
        if(!b){t=0;break;}
        if((s[i]==41&&a[b-1]==40)||(s[i]==93&&a[b-1]==91)) --b;
        else t=0;
      }
    }
    puts((t&&!b?1:0)?"yes":"no");
  }
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:9: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    3 |   while(gets(s),strcmp(s,".")){
      |         ^~~~
main.c:3:17: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
    3 |   while(gets(s),strcmp(s,".")){
      |                 ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcmp'
  +++ |+#include <string.h>
    1 | char s[110],a[110],b,i,t;
main.c:12:5: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   12 |     puts((t&&!b?1:0)?"yes":"no");
      |     ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | char s[110],a[110],b,i,t;
Language: C




int main(){
  int i,length=0;
  char array[100],s[100],c;

  while(gets(s),s[0]!='.'){
  for(i=0;s[i]!='\0';i++){
    c=s[i];
    if(c=='(' || c=='['){
      array[length]=c;
      length++;
    }
    else if(c==')'){
      if(array[length-1]=='('){
	length--;
      }
      else{
	length=-1;
	break;
      }
    }
    else if(c==']'){
      if(array[length-1]=='['){
	length--;
      }
      else{
	length=-1;
	break;
      }
    }
  }
  if(length==0)
    printf("yes\n");
  else
    printf("no\n");
  
  length=0;
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    8 |   while(gets(s),s[0]!='.'){
      |         ^~~~
main.c:35:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   35 |     printf("yes\n");
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | 
main.c:35:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   35 |     printf("yes\n");
      |     ^~~~~~
main.c:35:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:37:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   37 |     printf("no\n");
      |     ^~~~~~
main.c:37:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
  int i,length=0;
  char array[100],s[100],c;

  while(gets(s),s[0]!='.'){
  for(i=0;s[i]!='\0';i++){
    c=s[i];
    if(c=='(' || c=='['){
      array[length]=c;
      length++;
    }
    else if(c==')'){
      if(array[length-1]=='('){
	length--;
      }
      else{
	length=-1;
	break;
      }
    }
    else if(c==']'){
      if(array[length-1]=='['){
	length--;
      }
      else{
	length=-1;
	break;
      }
    }
  }
  if(length==0)
    printf("yes\n");
  else
    printf("no\n");
  
  length=0;
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |   while(gets(s),s[0]!='.'){
      |         ^~~~
      |         fgets
Language: C

#include<stdio.h>
#include<string.h>



void push(int *stack,int data,int *sp);
int pop(int *stack,int *sp);

int main(void){
  char str[128];
  int i,j,stack[N],sp,l,out,d;
  while(fgets(str,sizeof(str),stdin)&&str[0]!='.'){
    for(i=0;i<N;i++) stack[i]=0;
    sp=d=0;
    l=strlen(str);
    for(i=0;i<l;i++){
      if(str[i]=='('){
	push(stack,1,&sp);
      }else if(str[i]==')'){
	//puts("out:1");
	out=pop(stack,&sp);
	//printf("%d\n",out);
	if(out!=1){
	  d++;
	  goto shut;
	}
      }else if(str[i]=='['){
	push(stack,2,&sp);
      }else if(str[i]==']'){
	//puts("out:2");
	out=pop(stack,&sp);
	//printf("%d\n",out);
	if(out!=2){
	  d++;
	  goto shut;
	}
      }
    } 
  shut:
    if(d!=0) puts("NO");
    else puts("YES");
  }
  return 0;
}
      
void push(int *stack,int data,int *sp){
  stack[(*sp)++]=data;
}

int pop(int *stack,int *sp){
  if(*sp>0) return stack[--(*sp)];
  else return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: 'N' undeclared (first use in this function)
   11 |   int i,j,stack[N],sp,l,out,d;
      |                 ^
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>
#include<stack>
using namespace std;
int main()
{
  string h;
  getline(cin,h);
  while(h.size()!=1)
  {
   stack<char>s;
   bool l=true;
   for(int i=0;i<h.size();i++)
   {
    if(h[i]=='(' || h[i]=='[')s.push(h[i]);
    else if(h[i]==')' )
    {
     if(s.empty())
     {
      l=false;
      break;
     }
     if(s.top()=='(')s.pop();    
    }       
    else if(h[i]==']' )
    {
     if(s.empty())
     {
      l=false;
      break;
     }
     if(s.top()=='[')s.pop();    
    }
   }
   if(s.empty() && l)cout<<"yes"<<endl;
   else cout<<"no"<<endl;
   getline(cin,h);
  }
  
  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <stack>
using namespace std;

int main(){
  string s;
  while(getline(cin,s)){
    stack<char> st;
    if(s[0]=='.'break;
    bool ch=false;
    int i;
    for(i=0;i<s.size();i++){
      if(s[i]=='[' || s[i]=='(')st.push(s[i]);
      else if(s[i]==']'){
        if(st.empty() || st.top()!='[')ch=true;
        else if(!st.empty()) st.pop();
      }else if(s[i]==')'){
        if(st.empty() || st.top()!='(')ch=true;
        else if(!st.empty()) st.pop();
      }
    }
    if(ch)cout << "no" << endl;
    else cout << "yes" << endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: unable to find character literal operator 'operator""break' with 'char' argument
    9 |     if(s[0]=='.'break;
      |              ^~~~~~~~
a.cc:10:18: error: expected ')' before ';' token
   10 |     bool ch=false;
      |                  ^
      |                  )
a.cc:9:7: note: to match this '('
    9 |     if(s[0]=='.'break;
      |       ^
a.cc:15:40: error: 'ch' was not declared in this scope
   15 |         if(st.empty() || st.top()!='[')ch=true;
      |                                        ^~
a.cc:18:40: error: 'ch' was not declared in this scope
   18 |         if(st.empty() || st.top()!='(')ch=true;
      |                                        ^~
a.cc:22:8: error: 'ch' was not declared in this scope
   22 |     if(ch)cout << "no" << endl;
      |        ^~
Language: C++

#include <stdio.h>

int main(void){
  char c;
  bool ok;

  while(1){
    char s[101] = {0};
    ok = true;
    std::stack<char> st;
    for(int i=0; i<101; i++){
      scanf("%c", &c);
      if(c == '\n'){
	s[i] = '\0';
	break;
      }else{
	s[i] = c;
      }
    }

    if(s[0] == '.'){
      break;
    }

    for(int i=0; i<101; i++){
      if(s[i] == '.'){
	break;
      }
      if(s[i] == '(' || s[i] == '['){
	st.push(s[i]);
      }else if(str[i] == ')'){
	if(st.empty() || st.top()!='('){
	  ok = false;
	  break;
	}else{
	  st.pop();
	}
      }else if(str[i] == ']'){
	if(st.empty() || st.top() != '['){
	  ok = false;
	  break;
	}else{
	  st.pop();
	}
      }
    }

    if(!st.empty()){
      ok = false;
    }

    if(ok){
      printf("yes\n");
    }else{
      printf("no\n");
    }
    
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'stack' is not a member of 'std'
   10 |     std::stack<char> st;
      |          ^~~~~
a.cc:2:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    1 | #include <stdio.h>
  +++ |+#include <stack>
    2 | 
a.cc:10:16: error: expected primary-expression before 'char'
   10 |     std::stack<char> st;
      |                ^~~~
a.cc:30:9: error: 'st' was not declared in this scope; did you mean 's'?
   30 |         st.push(s[i]);
      |         ^~
      |         s
a.cc:31:16: error: 'str' was not declared in this scope; did you mean 'std'?
   31 |       }else if(str[i] == ')'){
      |                ^~~
      |                std
a.cc:32:12: error: 'st' was not declared in this scope; did you mean 's'?
   32 |         if(st.empty() || st.top()!='('){
      |            ^~
      |            s
a.cc:39:12: error: 'st' was not declared in this scope; did you mean 's'?
   39 |         if(st.empty() || st.top() != '['){
      |            ^~
      |            s
a.cc:48:9: error: 'st' was not declared in this scope; did you mean 's'?
   48 |     if(!st.empty()){
      |         ^~
      |         s
Language: C++

#include <stdio.h>
#include <stack>


int main(void){
  char c;
  bool ok;

  while(1){
    char s[101] = {0};
    ok = true;
    std::stack<char> st;
    for(int i=0; i<101; i++){
      scanf("%c", &c);
      if(c == '\n'){
	s[i] = '\0';
	break;
      }else{
	s[i] = c;
      }
    }
    
    if(s[0] == '.'){
      break;
    }
    
    for(int i=0; i<101; i++){
      if(s[i] == '.'){
	break;
      }
      if(s[i] == '(' || s[i] == '['){
	st.push(s[i]);
      }else if(s[i] == ')'){
	if(st.empty() || st.top()!='('){
	  ok = false;
	  break;
	}else{
	  st.pop();
	}
      }else if(str[i] == ']'){
	if(st.empty() || st.top() != '['){
	  ok = false;
	  break;
	}else{
	  st.pop();
	}
      }
    }
    
    if(!st.empty()){
      ok = false;
    }
    
    if(ok){
      printf("yes\n");
    }else{
      printf("no\n");
    }
    
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:16: error: 'str' was not declared in this scope; did you mean 'st'?
   40 |       }else if(str[i] == ']'){
      |                ^~~
      |                st
Language: C++

import java.util.Scanner;
import java.io.*;

/**
 * Created by Reopard on 2014/07/03.
 */
public class Main{
    static Scanner s = new Scanner(System.in);

    public static void main(String[] args)throws IOException{
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        char[] c = new char[100];
        char tmp;
        boolean flag=true;
        int p = 0;
        String text;
        while(true){
            text = br.readLine();
            p = 0;
            flag=true;
            if(text.equals(".")) break;

            for(int i = 0; i < text.length(); i++){
                tmp = text.charAt(i);

                if(tmp == '('){
                    c[p] = '(';
                    p++;
                }else if(tmp == '['){
                    c[p] = '[';
                    p++;
                }else if(tmp == ')'){
                    if(p > 0 && c[p - 1] == '('){
                        p--;
                    }else{
                        flag=false;
                    }
                }else if(tmp == ']'){
                    if(p > 0 && c[p - 1] == '['){
                        p--;
                    }else{
                        flag=false;
                    }
                }else if(tmp == '.'){
                    if(p == 0 && flag){
                        System.out.println("yes");
                        break;
                    }else{
                        System.out.println("no");
                        break;
                    }
                }
                if(i == text.length() - 1){
                    i = -1;
                    text = br.readLine();
                }
            }

        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: expected unqualified-id before 'public'
    7 | public class Main{
      | ^~~~~~
Language: C++

import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;


/**
 * Created by Reopard on 2014/07/03.
 */
public class Main{

    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        char[] c = new char[100];
        char tmp;
        boolean flag=true;
        int p = 0;
        String text;
        while(true){
            text = br.readLine();
            p = 0;
            flag=true;
            if(text.equals(".")) break;

            for(int i = 0; i < text.length(); i++){
                tmp = text.charAt(i);

                if(tmp == '('){
                    c[p] = '(';
                    p++;
                }else if(tmp == '['){
                    c[p] = '[';
                    p++;
                }else if(tmp == ')'){
                    if(p > 0 && c[p - 1] == '('){
                        p--;
                    }else{
                        flag=false;
                    }
                }else if(tmp == ']'){
                    if(p > 0 && c[p - 1] == '['){
                        p--;
                    }else{
                        flag=false;
                    }
                }else if(tmp == '.'){
                    if(p == 0 && flag){
                        System.out.println("yes");
                        break;
                    }else{
                        System.out.println("no");
                        break;
                    }
                }
                if(i == text.length() - 1){
                    i = -1;
                    text = br.readLine();
                }
            }

        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.IOException;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: expected unqualified-id before 'public'
    9 | public class Main{
      | ^~~~~~
Language: C++

import java.util.Scanner;
import java.util.Stack;


public class Main {
	
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		stdIn.useDelimiter("\\.");
		Stack<Character> stack;
		while(true) {
			String tmp = stdIn.nextLine();
			if(tmp.length() == 1) break;
			stack = new Stack<Character>();
			boolean isYes = true;
			for(int i = 0; i < tmp.length(); i++) {
				if(tmp.charAt(i) == '(') {
					stack.push('(');
				}
				if(tmp.charAt(i) == '[') {
					stack.push('[');
				}
				if(tmp.charAt(i) == ')') {
					if(stack.isEmpty() || stack.pop() != '(') {
						isYes = false;
					}
				}
				if(tmp.charAt(i) == ']') {
					if(stack.isEmpty() || stack.pop() != '[') {
						isYes = false;
					}
				}
				if(!isYes) {
					break;
				}
			}
			if(!stack.isEmpty()) {
				isYes = false;
			}
			System.out.println((isYes)?"yes":"no");
		}
		
	}
	
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Stack;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<stack>
using namespace std;

stack<char> st;

char str[514];
int slen;

int main() {
	int i;
	while( gets(str) ) {
		if ( str[0] == '.' && str[1] == '\0' )
			break;
		slen = strlen(str);
		for( i = 0; i < slen; i++ ) {
			if ( str[i] == '(' || str[i] == '[' )
				st.push(str[i]);
			if ( str[i] == ')' ) {
				if ( st.empty() || st.top() != '(' )
					break;
				st.pop();
			}
			if ( str[i] == ']' ) {
				if ( st.empty() || st.top() != '[' )
					break;
				st.pop();
			}
		}
		if ( i == slen )
			cout << "yes" << endl;
		else
			cout << "no" << endl;
		while(!st.empty())
			st.pop();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |         while( gets(str) ) {
      |                ^~~~
      |                getw
Language: C++

#include <cstdio>
#include <string>

int main() {
	int i, j;
	char t[101], c, st[101];
	while (true) {
		for (i = 0; ~scanf("%c", &c) && c != '\n'; i++) {
			t[i] = c;
		}
		t[i] = 0;
		if (t[0] == '.' && t[1] == 0) {
			return 0;
		} 
		memset(st, 0, sizeof st);
		for (i = 0, j = 0; i <= strlen(t); i++) {
			if (t[i] == '(' || t[i] == '[') {
				st[j++] = t[i];
			}
			if (t[i] == ')') {
				if (st[--j] != '(') {
					puts("no");
					break;
				}
			}
			if (t[i] == ']') {
				if (st[--j] != '[') {
					puts("no");
					break;
				}
			}
			if (t[i] == 0) {
				puts("yes");
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(st, 0, sizeof st);
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | 
a.cc:16:41: error: 'strlen' was not declared in this scope
   16 |                 for (i = 0, j = 0; i <= strlen(t); i++) {
      |                                         ^~~~~~
a.cc:16:41: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>

using namespace std;

int main() {
	int i, j;
	char t[101], c, st[101];
	while (true) {
		for (i = 0; ~scanf("%c", &c) && c != '\n'; i++) {
			t[i] = c;
		}
		t[i] = 0;
		if (t[0] == '.' && t[1] == 0) {
			return 0;
		} 
		memset(st, 0, sizeof st);
		for (i = 0, j = 0; i <= strlen(t); i++) {
			if (t[i] == '(' || t[i] == '[') {
				st[j++] = t[i];
			}
			if (t[i] == ')') {
				if (st[--j] != '(') {
					puts("no");
					break;
				}
			}
			if (t[i] == ']') {
				if (st[--j] != '[') {
					puts("no");
					break;
				}
			}
			if (t[i] == 0) {
				puts("yes");
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'memset' was not declared in this scope
   17 |                 memset(st, 0, sizeof st);
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | 
a.cc:18:41: error: 'strlen' was not declared in this scope
   18 |                 for (i = 0, j = 0; i <= strlen(t); i++) {
      |                                         ^~~~~~
a.cc:18:41: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include<string>
#include<algorithm>
#include<stdio.h>
using namespace std;

int main() 
{
	string s;
	while(true)
	{
		getline(cin,s);
		if(s==".")return 0;
		string t;
		//int len=s.size();
	//	cout<<0<<endl;
		for(int i=0;i<s.size();i++)
		{
			if(s[i]==' ')s.erase(s.begin()i);
		}
		cout<<s<<endl;
		t=s;
		for(int i=0;i<s.size();i++)
		{
		//	cout<<0<<endl;
			if(s[i]=='(')
			{
				for(int j=s.size()-1;i<j;j--)
				{
					if(s[j]==')')
					{
						t.erase(i);
						t.erase(j);
					}
				}
			}
			if(s[i]=='[')
			{
				for(int j=s.size()-1;i<j;j--)
				{
					if(s[j]==']')
					{
						t.erase(i);
						t.erase(j);
					}
				}
			}
		}
	//	cout<<0<<endl;
		for(int i=0;i<t.size();i++)
		{
			if(t[i]=='('||t[i]==')'||t[i]=='['||t[i]==']')
			{
				cout<<"no"<<endl;
				goto A;
			}
		}
		cout<<"yes"<<endl;
		A:;
		s.clear();
		t.clear();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:55: error: expected ')' before 'i'
   19 |                         if(s[i]==' ')s.erase(s.begin()i);
      |                                             ~         ^
      |                                                       )
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define int long long

char* Solve(string S)
{
    stack<char> s;
    for (int i = 0; i < S.size(); i++)
    {
        if (S[i] == '(') s.push(')');
        else if (S[i] == '[') s.push(']');
        else if (S[i] == ')' || S[i]] == ']')
        {
            if (s.empty() || s.top() != S[i]) return "no";
        }
    }
    if (!s.empty()) return "no";
    return "yes";
}

signed main()
{
    string S;
    while (getline(cin, S), S != ".")
    {
        printf("%s\n", Solve(S));
    }
    return 0;
}

Compiler output:
a.cc: In function 'char* Solve(std::string)':
a.cc:13:37: error: expected ')' before ']' token
   13 |         else if (S[i] == ')' || S[i]] == ']')
      |                 ~                   ^
      |                                     )
a.cc:13:37: error: expected primary-expression before ']' token
a.cc:18:28: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   18 |     if (!s.empty()) return "no";
      |                            ^~~~
a.cc:19:12: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   19 |     return "yes";
      |            ^~~~~