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

main(){
int a,b,m,n,o;
o=1;
scanf("%d%d",&a,&b);
char c[a+2][b+2];
for(n=0;n++-(b+2);)c[0][n]='.';
for(n=0;n++-(a+2);)c[n][0]='.';
for(n=0;n++-(b+2);)c[a+1][n]='.';
for(n=1;n++-(a+1);)for(m=1;m++-(b+2);)scanf("%c",&c[n][m]);
for(n=0;n++-(a+2);)c[n][b+1]='.';
for(n=1;n++-(a+1);)for(m=1;m++-(b+1);)if(c[n][m]='#'){
if((c[n-1][m-1]='#')||(c[n-1][m+1]='#')||(c[n+1][m-1]='#')||(c[n+1][m+1]='#'))o*=1; else o*=1;}
if(o)printf("Yes\n");else printf("No\n");

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | scanf("%d%d",&a,&b);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | scanf("%d%d",&a,&b);
      | ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:6: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 | if(o)printf("Yes\n");else printf("No\n");
      |      ^~~~~~
main.c:13:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:27: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 | if(o)printf("Yes\n");else printf("No\n");
      |                           ^~~~~~
main.c:13:27: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:1: error: expected declaration or statement at end of input
   13 | if(o)printf("Yes\n");else printf("No\n");
      | ^~
Language: C++

{
    // Your code here!
    int b,c,ans=0,preans=0;
    cin>>b>>c;
    char a[b+1][c+1];
    for(int i=0;i<b;i++){
        a[0][i]=='+';
    }
    for(int i=0;i<c;i++){
        a[i][0]=='+';
    }
    for(int i=1;i<b+1;i++){
        for(int j=1;j<c+1;j++){
            cin>>a[i][j];
            if(a[i][j]=='#'){
                preans++;
            }
        }
    }
    for(int i=1;i<b+1;i++){
        for(int j=1;j<c+1;j++){
            if(a[i][j]!='.' && (a[i-1][j]=='#'||a[i][j-1]=='#'||a[i][j+1]=='#' ||a[i+1][j]=='#') ){
                ans++;
            }        
        }

    }
    if(preans==ans){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt(); 
		int W = sc.nextInt(); 
		List<Boolean> MAP = new ArrayList<>();
		
		for(int i = 0; i < H*W; i++){
			String a = sc.next();
			if(a.equals("#")){
				MAP.add(true);
			}else{
				MAP.add(false);
			}
		}
		
		for(int i = 0; i < H*W; i++){
			if(MAP.get(i)){
				//↑判定
				if(i>W){
					if(MAP.get(i-W)){
						Yes();
					}
				}
				//←
				if(i > 0 && ((i - 1)% W) != 0){
					if(MAP.get(i-1)){
						Yes();
					}
				}
				
				//→
				if(i < H*W && i % W != 0){
					if(MAP.get(i+1)){
						Yes();
					}
				}
				
				if(i < H*W - W + 1){
					if(MAP.get(i+W)){
						Yes();
					}
				}
			}
		}
		
		System.out.println("No");
	}
	
	public static void Yes(){
		System.out.println("Yes");
		System.exit();
	}
}

















/*import java.util.*;
public class Main{

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(); 
		int B = sc.nextInt(); 
		int C = sc.nextInt();
		int K = sc.nextInt();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
}
*/

Compiler output:
Main.java:53: error: method exit in class System cannot be applied to given types;
		System.exit();
		      ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
1 error
Language: C

main(){
int a,b,m,n,o;
o=1;
scanf("%d%d",&a,&b);
char c[a+2][b+2];
for(n=0;n++-(b+2);)c[0][n]='.';
for(n=0;n++-(a+2);)c[n][0]='.';
for(n=0;n++-(b+2);)c[a+1][n]='.';
for(n=1;n++-(a+1);)for(m=1;m++-(b+2);)scanf("%c",&c[n][m]);
for(n=0;n++-(a+2);)c[n][b+1]='.';
for(n=1;n++-(a+1);)for(m=1;m++-(b+1);)if(c[n][m]='#'){
if(c[n-1][m-1]='#'||c[n-1][m+1]='#'||c[n+1][m-1]='#'||c[n+1][m+1]='#')o*=1;else o*=1;}
if(o)printf("Yes\n");else printf("No\n");

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | scanf("%d%d",&a,&b);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | scanf("%d%d",&a,&b);
      | ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:66: error: lvalue required as left operand of assignment
   12 | if(c[n-1][m-1]='#'||c[n-1][m+1]='#'||c[n+1][m-1]='#'||c[n+1][m+1]='#')o*=1;else o*=1;}
      |                                                                  ^
main.c:13:6: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 | if(o)printf("Yes\n");else printf("No\n");
      |      ^~~~~~
main.c:13:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:6: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:27: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 | if(o)printf("Yes\n");else printf("No\n");
      |                           ^~~~~~
main.c:13:27: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:1: error: expected declaration or statement at end of input
   13 | if(o)printf("Yes\n");else printf("No\n");
      | ^~
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt(); 
		int W = sc.nextInt(); 
		List<Boolean> MAP = new ArrayList<>();
		
		for(int i = 0; i < H*W; i++){
			String a = sc.next;
			if(a.equals("#")){
				MAP.Add(true);
			}else{
				MAP.Add(false);
			}
		}
		
		for(int i = 0; i < H*W; i++){
			if(MAP.get(i)){
				//↑判定
				if(i>W){
					if(MAP.get(i-W)){
						Yes();
					}
				}
				//←
				if(i > 0 && ((i - 1)% W) != 0){
					if(MAP.get(i-1)){
						Yes();
					}
				}
				
				//→
				if(i < H*W && i % W != 0){
					if(MAP.get(i+1)){
						Yes();
					}
				}
				
				if(i < H*W - W + 1){
					if(MAP.get(i+W)){
						Yes();
					}
				}
			}
		}
		
		System.out.println("No");
	}
	
	public void Yes(){
		System.out.println("Yes");
		exit();
	}
}

















/*import java.util.*;
public class Main{

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(); 
		int B = sc.nextInt(); 
		int C = sc.nextInt();
		int K = sc.nextInt();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
}
*/

Compiler output:
Main.java:10: error: cannot find symbol
			String a = sc.next;
			             ^
  symbol:   variable next
  location: variable sc of type Scanner
Main.java:12: error: cannot find symbol
				MAP.Add(true);
				   ^
  symbol:   method Add(boolean)
  location: variable MAP of type List<Boolean>
Main.java:14: error: cannot find symbol
				MAP.Add(false);
				   ^
  symbol:   method Add(boolean)
  location: variable MAP of type List<Boolean>
Main.java:23: error: non-static method Yes() cannot be referenced from a static context
						Yes();
						^
Main.java:29: error: non-static method Yes() cannot be referenced from a static context
						Yes();
						^
Main.java:36: error: non-static method Yes() cannot be referenced from a static context
						Yes();
						^
Main.java:42: error: non-static method Yes() cannot be referenced from a static context
						Yes();
						^
Main.java:53: error: cannot find symbol
		exit();
		^
  symbol:   method exit()
  location: class Main
8 errors
Language: C++

#include <bits\stdc++.h>
using namespace std;
char a[51][51];
bool b;
int main()
{
	int i,j,m,n,s;
	cin>>n>>m;
	for (i=1;i<=n;i++)
	  for (j=1;j<=m;j++)
	  cin>>a[i][j];
	for (i=1;i<=n;i++)
	  for (j=1;j<=n;j++) 
	{
		s=0;
		if (a[i][j]=='#')
		{
			if (a[i+1][j]!='#') s++;
			if (a[i-1][j]!='#') s++;
			if (a[i][j-1]!='#') s++;
			if (a[i][j+1]!='#') s++;
			if (s==4) {
				cout<<"No";
				return 0;
			}
		}
	}
	cout<<"Yes";
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt(); 
		int W = sc.nextInt(); 
		List<Boolean> MAP = new ArrayList<>();
		
		for(int i = 0; i < H*W; i++){
			String a = sc.next;
			if(a.equals("#")){
				MAP.Add(true);
			}else{
				MAP.Add(false);
			}
		}
		
		for(int i = 0; i < H*W; i++){
			if(MAP.get(i)){
				//↑判定
				if(i>W){
					if(MAP.get(i-W)){
						Yes();
					}
				}
				//←
				if(i > 0 && ((i - 1)% W) != 0){
					if(MAP.get(i-1)){
						Yes();
					}
				}
				
				//→
				if(i < H*W && i % W != 0){
					if(MAP.get(i+1)){
						Yes();
					}
				}
				
				if(i < H*W - W + 1){
					if(MAP.get(i+W)){
						Yes();
					}
				}
			}
		}
		
		System.out,println("No");
	}
	
	public void Yes(){
		System.out.println("Yes");
		exit();
	}
}

















/*import java.util.*;
public class Main{

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(); 
		int B = sc.nextInt(); 
		int C = sc.nextInt();
		int K = sc.nextInt();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
}
*/

Compiler output:
Main.java:48: error: not a statement
		System.out,println("No");
		      ^
Main.java:48: error: ';' expected
		System.out,println("No");
		          ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
main(){
  int h,w;
  cin>>h>>w;
  int s[h][w];
  char c;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>c;
      if(c=='.') s[i][j]=0;
      else s[i][j]=1;
    }
  }
  int ju=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]==1){
        if(!i){
          if(!j && s[i+1][j]==0 && s[i][j+1]==0) ju++;
          else if(j+1==w && s[i+1][j]==0 && s[i][j-1]==0) ju++;
          else if(s[i+1][j]==0 && s[i][j+1]==0 && s[i][j-1]==0) ju++;
        }else if(i+1<h){
          if(!j && s[i+1][j]==0 && s[i-1][j]==0 && s[i][j+1]==0) ju++;
          else if(j+1==w && s[i+1][j]==0 && s[i-1][j]==0 && s[i][j-1]==0) ju+
  +;
          else if(s[i+1][j]==0 && s[i][j+1]==0 && s[i-1][j]==0 && s[i][j-1]==
0) ju++;
        }else{
          if(!j && s[i][j+1]==0 && s[i-1][j]==0) ju++;
          else if(j+1==w && s[i][j-1]==0 && s[i-1][j]==0) ju++;
          else if(s[i-1][j]==0 && s[i][j-1]==0 && s[i][j+1]==0) ju++;
        }
      }
    }
  }
  if(ju) cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:26:4: error: expected primary-expression before ';' token
   26 |   +;
      |    ^
Language: C++

#include<iostream>
using namespace std;
int main(){
        int H,W,N;
        N=0;
        cin >> H >> W ;
        char s[H][W];
        int a[H][W];
        for(int i=0;i<H;i++){
                for(int j=0;j<W;j++){
                        a[i][j]=0;
                }
        }
        a[H][W]=1;
        for(int i=0;i<H;i++){
                for(int j=0;j<W;j++){
                        cin>>s[i][j];
                }
        }
        for(int i=0;i<W-1;i++){
                if(s[H][i]=='#'){
                                if(s[H][i+1]=='#')a[H][i]=1;
                        }
        }
        for(int i=0;i<H-1;i++){
                if(s[i][W]=='#'){
                                if(s[i+1][W]=='#')a[i][W]=1;
                        }
        }
        for(int i=0;i<H-1;i++){
                for(int j=0;j<W-1;j++){
                        if(s[i][j]=='#'){
                                if(s[i][j+1]=='#'||s[i+1][j]=='#')a[i][j]=1;
                        }
                }
        }
        for(int i=0;i<H;i++){
                for(int j=0;j<W;j++){
                        if(a[i][j]==0)N=1;
                        if(i=H-1&&j=W-1)cout<<"Yes"<<endl;
                }
        }
        if(N==1)cout<<"No"<<endl;
        return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:40:33: error: lvalue required as left operand of assignment
   40 |                         if(i=H-1&&j=W-1)cout<<"Yes"<<endl;
      |                              ~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
main(){
  int h,w;
  cin>>h>>w;
  int s[h][w];
  char c;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>c;
      if(c=='.') s[i][j]=0;
      else s[i][j]=1;
    }
  }
  int ju=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]==1){
        if(!i){
          if(!j && s[i+1][j]==0 && s[i][j+1]==0) ju++;
          else if(j+1==w && s[i+1][j]==0 && s[i][j-1]==0) ju++;
          else if(s[i+1][j]==0 && s[i][j+1]==0 && s[i][j-1]==0) ju++;
        }else if(i+1<h){
          if(!j && s[i+1][j]==0 && s[i-1][j]==0 && s[i][j+1]==0) ju++;
          else if(j+1==w && s[i+1][j]==0 && s[i-1][j]==0 && s[i][j-1]==0) ju+\
  +;
          else if(s[i+1][j]==0 && s[i][j+1]==0 && s[i-1][j]==0 && s[i][j-1]==\
0) ju++;
        }else{
          if(!j && s[i][j+1]==0 && s[i-1][j]==0) ju++;
          else if(j+1==w && s[i][j-1]==0 && s[i-1][j]==0) ju++;
          else if(s[i-1][j]==0 && s[i][j-1]==0 && s[i][j+1]==0) ju++;
        }
      }
    }
  }
  if(ju) cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:26:4: error: expected primary-expression before ';' token
   26 |   +;
      |    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    ll H, W;
    cin >> H >> W;
    string s[H];
    for(ll i = 0; i < H; i++) cin >> s[i];
    ll dh[] = {1, 0, -1, 0};
    ll dw[] = {0, 1, 0, -1};
    for(ll i = 0; i < H; i++){
        for(ll j = 0; j < W; j++){
            bool po = (s[i] == '.')
            for(ll k = 0; k < 4; k++){
                if(!(0 <= i + dh[k] && i + dh[k] < H && 0 <= j + dw[k] && j + dw[k] < W)) continue;
                po |= (s[i + dh[k]][j + dw[k]] == '#');
            }
            if(!po){
                cout << "No\n";
                return 0;
            }
        }
    }
    cout << "Yes\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll H, W;
      |     ^~
a.cc:5:12: error: 'H' was not declared in this scope
    5 |     cin >> H >> W;
      |            ^
a.cc:5:17: error: 'W' was not declared in this scope
    5 |     cin >> H >> W;
      |                 ^
a.cc:7:11: error: expected ';' before 'i'
    7 |     for(ll i = 0; i < H; i++) cin >> s[i];
      |           ^~
      |           ;
a.cc:7:19: error: 'i' was not declared in this scope
    7 |     for(ll i = 0; i < H; i++) cin >> s[i];
      |                   ^
a.cc:7:38: error: 's' was not declared in this scope
    7 |     for(ll i = 0; i < H; i++) cin >> s[i];
      |                                      ^
a.cc:8:7: error: expected ';' before 'dh'
    8 |     ll dh[] = {1, 0, -1, 0};
      |       ^~~
      |       ;
a.cc:9:7: error: expected ';' before 'dw'
    9 |     ll dw[] = {0, 1, 0, -1};
      |       ^~~
      |       ;
a.cc:10:11: error: expected ';' before 'i'
   10 |     for(ll i = 0; i < H; i++){
      |           ^~
      |           ;
a.cc:10:19: error: 'i' was not declared in this scope
   10 |     for(ll i = 0; i < H; i++){
      |                   ^
a.cc:11:15: error: expected ';' before 'j'
   11 |         for(ll j = 0; j < W; j++){
      |               ^~
      |               ;
a.cc:11:23: error: 'j' was not declared in this scope; did you mean 'jn'?
   11 |         for(ll j = 0; j < W; j++){
      |                       ^
      |                       jn
a.cc:12:24: error: 's' was not declared in this scope
   12 |             bool po = (s[i] == '.')
      |                        ^
a.cc:13:27: error: 'k' was not declared in this scope
   13 |             for(ll k = 0; k < 4; k++){
      |                           ^
Language: C++

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

int main(void) {
  int H, W;
  cin >> H >> W;
  vector<vector<char> > s;
  for(&x : s) {
    for(&cell : x) {
      cin >> cell;
    }
  }
  
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      if(s[i][j] == '#') {
		if(i > 0 && s[i-1][j] == '#') continue;
        if(j > 0 && s[i][j-1] == '#') continue;
        if(i < H-1 && s[i+1][j] == '#') continue;
        if(j < W-1 && s[i][j+1] == '#') continue;
        //can't draw
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: found ':' in nested-name-specifier, expected '::'
    9 |   for(&x : s) {
      |          ^
      |          ::
a.cc:9:8: error: 'x' has not been declared
    9 |   for(&x : s) {
      |        ^
a.cc:15:3: error: expected primary-expression before 'for'
   15 |   for(int i = 0; i < H; i++) {
      |   ^~~
a.cc:13:4: error: expected ';' before 'for'
   13 |   }
      |    ^
      |    ;
   14 | 
   15 |   for(int i = 0; i < H; i++) {
      |   ~~~
a.cc:15:3: error: expected primary-expression before 'for'
   15 |   for(int i = 0; i < H; i++) {
      |   ^~~
a.cc:13:4: error: expected ')' before 'for'
   13 |   }
      |    ^
      |    )
   14 | 
   15 |   for(int i = 0; i < H; i++) {
      |   ~~~
a.cc:9:6: note: to match this '('
    9 |   for(&x : s) {
      |      ^
Language: C

#include <iostream>
using namespace std;
int N, A;
int main() {
	cin >> N >> A;
	cout << (N % 500 <= A ? "Yes" : "No") << endl;
	return 0;
}


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

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

int dir[10]={1,0,0,1,-1,0,0,-1};

int main()
{
    int m,n,flag;
    char mapp[52][52];
    bool mm[52][52];
    memset(mapp,'.',sizeof(mapp));
    memset(mm,true,sizeof(mm));
    cin>>m>>n;
    getchar();
    for(int i=1;i<m+1;i++)
        gets(&mapp[i][1]);
    for(int i=1;i<m+1;i++)
    {
        for(int k=1;k<n+1;k++)
        {
           flag=1;
            if(mapp[i][k]=='#')
            {
                flag=0;
                //cout<<i<<" !"<<k<<endl;
                for(int p=0;p<8;p+=2)
                {
                    if(mapp[i+dir[p]][k+dir[p+1]]=='#')
                    {
                        //cout<<i<<" "<<k<<endl;
                        flag=1;
                        break;
                    }
                }

            }
            if(!flag)
            {
                //cout<<i<<" "<<k<<endl;
                cout<<"No";
                return 0;
            }
        }
    }
    cout<<"Yes";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |         gets(&mapp[i][1]);
      |         ^~~~
      |         getw
Language: C++

#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
const int inf=1<<30;
int main(){
  int H,W;bool canvas[60][60],ans=true;cin>>H>>W;
  char tmp;
  memset(canvas,false,sizeof(canvas));
  for(int h=1;h<=H;h++){
    for(int w=1;w<=W;w++){
      cin>>tmp;
      if(tmp=='#')canvas[h][w]=true;
    }
  }
  for(int h=1;h<=H;h++){
    for(int w=1;w<=W;w++){
      //if(canvas[h][w])printf("canvas[%d][%d] is painted.\n",h,w);
      if(canvas[h][w])if((!canvas[h][w-1]&&!canvas[h][w+1])&&(!canvas[h+1][w]&&!canvas[h-1][w])){
        //printf("canvas[%d][%d] cannot be painted.\n",h,w);
        ans=false;
      }
    }
  }
  if(ans)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'memset' was not declared in this scope
   12 |   memset(canvas,false,sizeof(canvas));
      |   ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<math.h>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

int main() {
	int h,w;
	cin >> h >> w;
	char a[h][w];
	bool ok = true;
	//上からh左からw
	for (int i = 0;i < n;i++) {
		for (int j = 0;j < n;j++) {
			cin >> a[i][j];
		}
	}
	for (int i = 0;i < n;i++) {
		for (int j = 0;j < n;j++) {
			if (i == 0) {
				if (j == 0) {
					if (a[i][j] == '#') {
						if (a[i+1][j] != '#' || a[i][j+1] != '#') {
							ok = false;
						}
					}
				} else if (j == w - 1) {
					if (a[i][j] == '#') {
						if (a[i+1][j] != '#' || a[i][j-1] != '#') {
							ok = false;
						}
					}
				} else {
					if (a[i][j] == '#') {
						if (a[i+1][j] != '#' || a[i][j+1] != '#' || a[i][j-1] != '#') {
							ok = false;
						}
					}
				}
			} else if (i == h - 1) {
				if (j == 0) {
					if (a[i][j] == '#') {
						if (a[i-1][j] != '#' || a[i][j+1] != '#') {
							ok = false;
						}
					}
				} else if (j == w - 1) {
					if (a[i][j] == '#') {
						if (a[i-1][j] != '#' || a[i][j-1] != '#') {
							ok = false;
						}
					}
				} else {
					if (a[i][j] == '#') {
						if (a[i-1][j] != '#' || a[i][j+1] != '#' || a[i][j-1] != '#') {
							ok = false;
						}
					}
				}
			} else {
				if (j == 0) {
					if (a[i][j] == '#') {
						if (a[i-1][j] != '#' || a[i+1][j] != '#' || a[i][j+1] != '#') {
							ok = false;
						}
					}
				} else if (j == w - 1) {
					if (a[i][j] == '#') {
						if (a[i-1][j] != '#' || a[i+1][j] != '#' || a[i][j-1] != '#') {
							ok = false;
						}
					}
				} else {
					if (a[i][j] == '#') {
						if (a[i-1][j] != '#' || a[i+1][j] != '#' || a[i][j+1] != '#' || a[i][j-1] != '#') {
							ok = false;
						}
					}
				}
			}
		}
	}
	if (ok) {
		cout << "Yes";
	} else {
		cout << "No";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: 'n' was not declared in this scope
   10 |         for (int i = 0;i < n;i++) {
      |                            ^
a.cc:15:28: error: 'n' was not declared in this scope
   15 |         for (int i = 0;i < n;i++) {
      |                            ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main() {
	vector<int> a(3);
	int K, c = 0;
	cin >> a.at(0) >> a.at(1) >> a.at(2) >>  K;
	int maxi = 0;
	for (int i = 0; i < 3; i++) {
		if (maxi < a.at(i)){
			maxi = a.at(i);
			 		
		}
		c += a.at(i);
	}
	cout << c - maxi + maxi * std::pow(2, K) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:40: error: 'pow' is not a member of 'std'
   19 |         cout << c - maxi + maxi * std::pow(2, K) << endl;
      |                                        ^~~
Language: C++

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

using namespace std;

char M[100][100];
int val[100][100], vis[100][100];

int main()
{
    int H, W;

    scanf("%d%d", &H, &W);
    getchar();

    for (int i = 1; i <= H; i++) gets(M[i] + 1);

    memset(val, 0, sizeof (val));
    memset(vis, 0, sizeof (vis));

    for (int i = 1; i <= H; i++) for (int j = 1; j <= W; j++) if (M[i][j] == '#') val[i][j] = 1;

    for (int i = 1; i <= H; i++) for (int j = 2; j <= W; j++) if (M[i][j] == '#' && M[i][j - 1] == '#') vis[i][j] = vis[i][j - 1] = 1;
    for (int j = 1; j <= W; j++) for (int i = 2; i <= H; i++) if (M[i][j] == '#' && M[i - 1][j] == '#') vis[i][j] = vis[i - 1][j] = 1;

    bool ans = true;

    for (int i = 1; i <= H; i++) for (int j = 1; j <= W; j++) if (val[i][j] != vis[i][j]) ans = false;

    printf("%s\n", ans ? "Yes" : "No");

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |     for (int i = 1; i <= H; i++) gets(M[i] + 1);
      |                                  ^~~~
      |                                  getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int dx[]={0,0,1,-1},dy[]={-1,1,0,0};
int h,w;
char s[55][55];
int main()
{
    ios::sync_with_stdio(false);
    cin>>h>>w;
    rep(i,h)
    	rep(j,w)
			cin>>s[i][j];
	rep(i,h)
		rep(j,w)
		{
			if(s[i][j]=='.') continue;
			bool flag=false;
			rep(k,4)
			{
				int x2=i+dx[k],y2=j+dy[k];
				if(s[i][j]=='#'&&s[x2][y2]=='#')
					flag=true;
			}
			if(!flag)
			{
				cout<<"No"<<endl;
				return 0;
			}
		}
	cout<<"Yes"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     rep(i,h)
      |         ^
a.cc:10:5: error: 'rep' was not declared in this scope
   10 |     rep(i,h)
      |     ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

char M[100][100];
int val[100][100], vis[100][100];

int main()
{
    int H, W;

    scanf("%d%d", &H, &W);
    getchar();

    for (int i = 1; i <= H; i++) gets(M[i] + 1);

    memset(val, 0, sizeof (val));
    memset(vis, 0, sizeof (vis));

    for (int i = 1; i <= H; i++) for (int j = 1; j <= W; j++) if (M[i][j] == '#') val[i][j] = 1;

    for (int i = 1; i <= H; i++) for (int j = 2; j <= W; j++) if (M[i][j] == '#' && M[i][j - 1] == '#') vis[i][j] = vis[i][j - 1] = 1;
    for (int j = 1; j <= W; j++) for (int i = 2; i <= H; i++) if (M[i][j] == '#' && M[i - 1][j] == '#') vis[i][j] = vis[i - 1][j] = 1;

    bool ans = true;

    for (int i = 1; i <= H; i++) for (int j = 1; j <= W; j++) if (val[i][j] != vis[i][j]) ans = false;

    printf("%s\n", ans ? "Yes" : "No");

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:34: error: 'gets' was not declared in this scope; did you mean 'getw'?
   17 |     for (int i = 1; i <= H; i++) gets(M[i] + 1);
      |                                  ^~~~
      |                                  getw
Language: C++

#include<algorithm>
#include<clocale>
#include<cmath>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<iostream>
#include<istream>
#include<map>
#include<math.h>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<string>
#include<vector>
using namespace std;
int n,k,dx[]={0,1,0,-1},dy[]={1,0,-1,0};
char c[100][100];
int main()
{
	cin>>n>>k;
	for (int i=0;i<n;i++)
		for (int j=0;j<k;j++)
			cin>>c[i][j];
	for (int i=0;i<n;i++)
		for (int j=0;j<k;j++){
			int f=0;
			for (int k=0;k<4;k++)
			if (i+dx[k]>=0&&i+dx[k]<n&&j+dy[k]>=0&&j+dy[k]<m&&c[i+dx[k]][j+dy[k]]=='.') f++;
			if (f==4){
				cout<<"No"<<endl;
				return 0;
			}
		}
	cout<<"Yes"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:72: error: 'm' was not declared in this scope
   37 |                         if (i+dx[k]>=0&&i+dx[k]<n&&j+dy[k]>=0&&j+dy[k]<m&&c[i+dx[k]][j+dy[k]]=='.') f++;
      |                                                                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n,m;
char a[51][51];
int i,j;
bool ;
void check_U()
{
	if(i!=0&&a[i-1][j]=='#')
		s=true;
}
void check_D()
{
	check_U();
	if(i!=n-1&&a[i+1][j]=='#')
		s=true;
}
void check_L()
{
	check_D();
	if(j!=0&&a[i][j-1]=='#')
		s=true;
}
void check_R()
{
	check_L();
	if(j!=m-1&&a[i][j+1]=='#')
		s=true;
}
void check()
{
	check_R();
}
int main()
{
	scanf("%d %d",&n,&m);
	getchar();
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			scanf("%c",&a[i][j]);
		}
		getchar();
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(a[i][j]=='.')
				continue;
			s=false;
			check();
			if(!s)
			{
				printf("No");
				return 0;
			}
		}
	}
	printf("Yes");
	return 0;
}

Compiler output:
a.cc:6:1: error: declaration does not declare anything [-fpermissive]
    6 | bool ;
      | ^~~~
a.cc: In function 'void check_U()':
a.cc:10:17: error: 's' was not declared in this scope
   10 |                 s=true;
      |                 ^
a.cc: In function 'void check_D()':
a.cc:16:17: error: 's' was not declared in this scope
   16 |                 s=true;
      |                 ^
a.cc: In function 'void check_L()':
a.cc:22:17: error: 's' was not declared in this scope
   22 |                 s=true;
      |                 ^
a.cc: In function 'void check_R()':
a.cc:28:17: error: 's' was not declared in this scope
   28 |                 s=true;
      |                 ^
a.cc: In function 'int main()':
a.cc:52:25: error: 's' was not declared in this scope
   52 |                         s=false;
      |                         ^
Language: C++

#include <iostream>
using namespace std;
char str[55][55];
int h,w;
int next[4][2]={
	0,1,
	1,0,
	0,-1,
	-1,0
};

bool pd() {
	int nx,ny;
	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++) {
			if(str[i][j]=='#') {
				bool flag=false;
				for(int k=0;k<4;k++) {
					nx=i+next[k][0];
					ny=j+next[k][1];
					if(nx>=0&&nx<h&&ny>=0&&ny<w&&str[nx][ny]=='#')
						flag=true;
				}
				if(!flag)
					return false;
			}
		}
	return true;
}

int main(){
	cin>>h>>w;
	for(int i=0;i<h;i++) {
		cin>>str[i];
	}
	if(pd()) {
		cout<<"Yes"<<endl;
	}else
		cout<<"No"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool pd()':
a.cc:19:46: error: reference to 'next' is ambiguous
   19 |                                         nx=i+next[k][0];
      |                                              ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:5:5: note:                 'int next [4][2]'
    5 | int next[4][2]={
      |     ^~~~
a.cc:20:46: error: reference to 'next' is ambiguous
   20 |                                         ny=j+next[k][1];
      |                                              ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:5:5: note:                 'int next [4][2]'
    5 | int next[4][2]={
      |     ^~~~
Language: C++

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

int main()
{
    int n, m;
    cin >> n >> m;
    vector < vector <int> > vv(n, vector <int> (m)), flag(n, vector <int> (m));
    for(int i = 0; i < n; i++)
        for(int j = 0; j < m; j++)
        {
            char x;
            cin >> x;
            if(x == '#')
                vv[i][j] = 1;
        }
    for(int i = 0; i < n; i++)
        for(int j = 0; j < m; j++)
        {
            if(i - 1 > 0 && vv[i - 1][j] == 1)
                flag[i][j] = 1;
            if(i + 1 < n && vv[i + 1][j] == 1)
                flag[i][j] = 1;
            if(j - 1 > 0 && vv[i][j - 1] == 1)
                flag[i][j] = 1;
            if(j + 1 < m && vv[i][j + 1] == 1)
                flag[i][j] = 1;
        }
    for(int i = 0; i < n; i++)
        for(int j = 0; j < m; j++)
            if(vv[i][j] == 1 && !flag[i][j])
                return cout << "No", 0;
    cout << "Yes";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector < vector <int> > vv(n, vector <int> (m)), flag(n, vector <int> (m));
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:9:22: error: expected primary-expression before 'int'
    9 |     vector < vector <int> > vv(n, vector <int> (m)), flag(n, vector <int> (m));
      |                      ^~~
a.cc:16:17: error: 'vv' was not declared in this scope
   16 |                 vv[i][j] = 1;
      |                 ^~
a.cc:21:29: error: 'vv' was not declared in this scope
   21 |             if(i - 1 > 0 && vv[i - 1][j] == 1)
      |                             ^~
a.cc:22:17: error: 'flag' was not declared in this scope
   22 |                 flag[i][j] = 1;
      |                 ^~~~
a.cc:23:29: error: 'vv' was not declared in this scope
   23 |             if(i + 1 < n && vv[i + 1][j] == 1)
      |                             ^~
a.cc:24:17: error: 'flag' was not declared in this scope
   24 |                 flag[i][j] = 1;
      |                 ^~~~
a.cc:25:29: error: 'vv' was not declared in this scope
   25 |             if(j - 1 > 0 && vv[i][j - 1] == 1)
      |                             ^~
a.cc:26:17: error: 'flag' was not declared in this scope
   26 |                 flag[i][j] = 1;
      |                 ^~~~
a.cc:27:29: error: 'vv' was not declared in this scope
   27 |             if(j + 1 < m && vv[i][j + 1] == 1)
      |                             ^~
a.cc:28:17: error: 'flag' was not declared in this scope
   28 |                 flag[i][j] = 1;
      |                 ^~~~
a.cc:32:16: error: 'vv' was not declared in this scope
   32 |             if(vv[i][j] == 1 && !flag[i][j])
      |                ^~
a.cc:32:34: error: 'flag' was not declared in this scope
   32 |             if(vv[i][j] == 1 && !flag[i][j])
      |                                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int M[52][52];
int main(void)
{
	int H,W;
	scanf("%d %d",&H,&W);
	for(int i=0;i<H;i++)
		scanf("%s",&M[i]);
	int tr=1;
	for(int i=0;i<H;i++)
	for(int j=0;j<W;j++)
		if( M[i][j]=='#'&&(M[i][j+1]=='#'||M[i+1][j]=='#') tr=0;
	if(tr) printf("Yes");
	else printf("No");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:67: error: expected ';' before 'tr'
   13 |                 if( M[i][j]=='#'&&(M[i][j+1]=='#'||M[i+1][j]=='#') tr=0;
      |                                                                   ^~~
      |                                                                   ;
a.cc:14:9: error: expected primary-expression before 'if'
   14 |         if(tr) printf("Yes");
      |         ^~
a.cc:13:73: error: expected ')' before 'if'
   13 |                 if( M[i][j]=='#'&&(M[i][j+1]=='#'||M[i+1][j]=='#') tr=0;
      |                   ~                                                     ^
      |                                                                         )
   14 |         if(tr) printf("Yes");
      |         ~~
Language: C++

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios		ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
	ios
	int h,w;
	cin>>h>>w;
	char a[100][100];

	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		cin>>a[i][j];
	}
	for(int i=0;i<=h+1;i++)
	{
		a[i][0]='.';
		a[i][w+1]='.';
	}
	for(int j=0;j<=w+1;j++)
	{
		a[0][j]='.';
		a[h+1][j]='.';
	}
	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		{
			if(a[i][j]=='#')
			{
				if(a[i][j-1]=='#'||a[i][j+1]=='#'||a[i+1][j]=='#'||a[i-1][j]=='#')
				continue;
				else
				{
					cout<<"No"
					return 0;
				}	
			}
		}
	}
	cout<<"Yes";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:51: error: expected ';' before 'return'
   48 |                                         cout<<"No"
      |                                                   ^
      |                                                   ;
   49 |                                         return 0;
      |                                         ~~~~~~
Language: C++

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios		ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
	ios
	int h,w;
	cin>>h>>w;
	char a[100][100];

	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		cin>>a[i][j];
	}
	for(int i=0;i<=h+1;i++)
	{
		a[i][0]='.';
		a[i][w+1]='.';
	}
	for(int j=0;j<=w+1;j++)
	{
		a[0][j]='.'
		a[h+1][j]='.'
	}
	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		{
			if(a[i][j]=='#')
			{
				if(a[i][j-1]=='#'||a[i][j+1]=='#'||a[i+1][j]=='#'||a[i-1][j]=='#')
				continue;
				else
				{
					cout<<"NO";
					return 0;
				}	
			}
		}
	}
	cout<<"YES";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:28: error: expected ';' before 'a'
   35 |                 a[0][j]='.'
      |                            ^
      |                            ;
   36 |                 a[h+1][j]='.'
      |                 ~
Language: C++

#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int MAX=1e6+10;
char str[100][100];
int main()
{
    int n, m;
    cin >> n >> m;
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= m; j++)
        cin >> str[i][j];
    }
    bool flag = false;
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= m; j++)
        {
            if(str[i][j] == '#')sum++;
            {
                int sum = 0;
                if(str[i+1][j] != '#')sum++;
                if(str[i-1][j] != '#')sum++;
                if(str[i][j+1] != '#')sum++;
                if(str[i][j-1] != '#')sum++;
                if(sum == 4)flag = true;
            }
        }
    }
    if(flag)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'sum' was not declared in this scope
   20 |             if(str[i][j] == '#')sum++;
      |                                 ^~~
Language: C++

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios		ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
	ios
	int h,w;
	cin>>h>>w;
	char a[100][100];

	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		cin>>a[i][j];
	}
	for(int i=0;i<=h+1;i++)
	{
		a[i][0]='.';
		a[i][w+1]='.'
	}
	for(int j=0;j<=w+1;j++)
	{
		a[0][j]='.'
		a[h+1][j]='.'
	}
	for(int i=0;i<h;i++)
	{
		for(int j=0;j<w;j++)
		{
			if(a[i][j]=='#')
			{
				if(a[i][j-1]=='#'||a[i][j+1]=='#'||a[i+1][j]=='#'||a[i-1][j]=='#')
				continue;
				else
				{
					cout<<"NO";
					return 0;
				}	
			}
		}
	}
	cout<<"YES";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: expected ';' before '}' token
   31 |                 a[i][w+1]='.'
      |                              ^
      |                              ;
   32 |         }
      |         ~                     
a.cc:35:28: error: expected ';' before 'a'
   35 |                 a[0][j]='.'
      |                            ^
      |                            ;
   36 |                 a[h+1][j]='.'
      |                 ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
    string h;
    cin>>h;
  for(int i=0;i<a*b;i++)
    if(h[i]=='#'&&h[i-1]!='#'&&h[i+1]!='#'&&h[i+a]!='#'&&h[i-a]!='#'){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
cout<<"No"<<endl;
}

Compiler output:
a.cc:14:1: error: 'cout' does not name a type
   14 | cout<<"No"<<endl;
      | ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

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

#define EPS (1e-7)
#define INF (99999999999L)
#define PI (acos(-1))

#define FOR(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define REP(i,n) FOR(i,0,n)

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using ll = long long;

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

int main() {
  int h, w; cin >> h >> w;
  vector<string> s(h); REP(i,h) cin >> s[i];
  if (h == 1 && w == 1) {cout << "Yes" << endl; return 0;}
  REP(i,h) REP(j,w) {
    bool f = false
    REP(k,4) {
      int x = i+dx[i], y = j+dy[i];
      if (0 <= x&& x <h && 0 <= y && y < w) {
        if (s[x][y] == '#') f = true;
      }
    }
    if (!f) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected ',' or ';' before 'for'
    8 | #define FOR(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
      |                    ^~~
a.cc:9:18: note: in expansion of macro 'FOR'
    9 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:27:5: note: in expansion of macro 'REP'
   27 |     REP(k,4) {
      |     ^~~
a.cc:27:9: error: 'k' was not declared in this scope
   27 |     REP(k,4) {
      |         ^
a.cc:8:48: note: in definition of macro 'FOR'
    8 | #define FOR(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
      |                                                ^
a.cc:27:5: note: in expansion of macro 'REP'
   27 |     REP(k,4) {
      |     ^~~
a.cc:27:9: error: 'k_len' was not declared in this scope; did you mean 'j_len'?
   27 |     REP(k,4) {
      |         ^
a.cc:8:50: note: in definition of macro 'FOR'
    8 | #define FOR(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
      |                                                  ^
a.cc:27:5: note: in expansion of macro 'REP'
   27 |     REP(k,4) {
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
int main(){
    int H,W;
    cin >> H >> W;
    vector<string> S;
    for(int i=0; i<H; i++){
        string t;
        cin >> t;
        S.push_back(t);
    }
    bool flg = true;
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            if(S[i][j]=='#'){
                bool tmp = false;
                if(j-1 >= 0 && S[i][j-1]=='#') tmp = true;
                if(i-1 >= 0 && S[i-1][j]=='#') tmp = true;
                if(j+1 < W && S[i][j+1]=='#') tmp = true;
                if(i+1 < H 0 && S[i+1][j]=='#') tmp = true;
                if(!tmp) flg = false;
            }
            
        }
    }
    if(flg) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:27: error: expected ')' before numeric constant
   27 |                 if(i+1 < H 0 && S[i+1][j]=='#') tmp = true;
      |                   ~       ^~
      |                           )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
int main(){
    int H,W;
    cin >> H >> W;
    vector<string> S;
    for(int i=0; i<H; i++){
        strint t;
        cin >> t;
        S.push_back(t);
    }
    bool flg = true;
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            if(S[i][j]=='#'){
                bool tmp = false;
                if(j-1 >= 0 && S[i][j-1]=='#') tmp = true;
                if(i-1 >= 0 && S[i-1][j]=='#') tmp = true;
                if(j+1 < W && S[i][j+1]=='#') tmp = true;
                if(i+1 < H 0 && S[i+1][j]=='#') tmp = true;
                if(!tmp) flg = false;
            }
            
        }
    }
    if(flg) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'strint' was not declared in this scope; did you mean 'strcat'?
   15 |         strint t;
      |         ^~~~~~
      |         strcat
a.cc:16:16: error: 't' was not declared in this scope
   16 |         cin >> t;
      |                ^
a.cc:27:27: error: expected ')' before numeric constant
   27 |                 if(i+1 < H 0 && S[i+1][j]=='#') tmp = true;
      |                   ~       ^~
      |                           )
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int h, w; cin >> h >> w;
  int s[100];
  for(int i = 0; i < h; i++) {
    cin >> s[i];
  }
  for(int i = 0; i < h; i++) {
    for(int j = 0; j < w; j++) {
      if(s[i][j] != '#') continue;
      int f = 0;
      for(int d = 0; d < 4; d++) {
        int ni = i + dy[d];
        int nj = j + dx[d];
        if(ni < 0 || h <= ni || nj < 0 || w <= nj) continue;
        if(s[ni][nj] == '#') f = 1;
      }
      if(!f) return (cout << "No" << endl, 0);
    }
  }
  cout << "Yes" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: invalid types 'int[int]' for array subscript
   15 |       if(s[i][j] != '#') continue;
      |              ^
a.cc:21:17: error: invalid types 'int[int]' for array subscript
   21 |         if(s[ni][nj] == '#') f = 1;
      |                 ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class prime1mod5 { // https://atcoder.jp/contests/abc096/tasks/abc096_d
	static ArrayList<Integer> primes = new ArrayList<Integer>();
	
	static boolean isPrime(int x) {
		if (x == 2 || x == 3) return true;
		if (x < 2) return false;
		
		for (int i = 2; i * i <= 2 * x; i++) {
			if (x % i == 0) return false;
		}
		return true;
	}
	
	static void init(int psize, int modd) {
		int cur = modd;
		while (primes.size() < psize) {
			if (isPrime(cur)) primes.add(cur);
			
			cur += 5;
		}
	}
	
	public static void main(String[] args) { 
		Scanner x = new Scanner(System.in);
		int n = x.nextInt();
		long start = System.nanoTime();
		init(n, 2);
	//	System.out.println((System.nanoTime() - start) / 1000000);
		
		for (int i : primes) System.out.print(i + " ");
	}
}


Compiler output:
Main.java:4: error: class prime1mod5 is public, should be declared in a file named prime1mod5.java
public class prime1mod5 { // https://atcoder.jp/contests/abc096/tasks/abc096_d
       ^
1 error