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

#include <iostream>
#include <string>
#include <array>

int Baseball()
{
    int num_of_runner = 0, num_of_out = 0, point = 0;
    std::string event;
    while(num_of_out != 3){
        std::cin >> event;
        switch(event){
            case HIT:
                if(num_of_runner == 3);
                    ++point;
                else
                    ++num_of_runner;
                break;
            case HOMERUN:
                point += 1 + num_of_runner;
                num_of_runner = 0;
                break;
            case OUT:
                ++num_of_out;
                break;
        }
    }
    
    return point;
}

int main()
{
    u_int num_of_inning;
    std::cin >> num_of_inning;
    
    for(u_int i = 0; i < num_of_inning; ++i){
        std::cout << Baseball() << std::endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int Baseball()':
a.cc:11:16: error: switch quantity not an integer
   11 |         switch(event){
      |                ^~~~~
a.cc:12:18: error: 'HIT' was not declared in this scope
   12 |             case HIT:
      |                  ^~~
a.cc:15:17: error: 'else' without a previous 'if'
   15 |                 else
      |                 ^~~~
a.cc:18:18: error: 'HOMERUN' was not declared in this scope
   18 |             case HOMERUN:
      |                  ^~~~~~~
a.cc:22:18: error: 'OUT' was not declared in this scope
   22 |             case OUT:
      |                  ^~~
Language: C++

#include <iostream>
#include <string>

int Baseball()
{
    int num_of_runner = 0, num_of_out = 0, point = 0;
    std::string event;
    while(num_of_out != 3){
        std::cin >> event;
        if(event == HIT){
            if(num_of_runner == 3)
                ++point;
            else
                ++num_of_runner;
        }
        else if(evenr == HOMERUN){
            point += 1 + num_of_runner;
            num_of_runner = 0;
        }
        else
            ++num_of_out;
    }
    
    return point;
}

int main()
{
    u_int num_of_inning;
    std::cin >> num_of_inning;
    
    for(u_int i = 0; i < num_of_inning; ++i){
        std::cout << Baseball() << std::endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int Baseball()':
a.cc:10:21: error: 'HIT' was not declared in this scope
   10 |         if(event == HIT){
      |                     ^~~
a.cc:16:17: error: 'evenr' was not declared in this scope; did you mean 'event'?
   16 |         else if(evenr == HOMERUN){
      |                 ^~~~~
      |                 event
a.cc:16:26: error: 'HOMERUN' was not declared in this scope
   16 |         else if(evenr == HOMERUN){
      |                          ^~~~~~~
Language: C++

#include <iostream>
#include <string>

int Baseball()
{
    const u_int num_of_event = 100;
    int num_of_runner = 0, num_of_out = 0, point = 0;
    std::string event;
    
    for(u_int i = 0; i < num_of_event; ++i){
        std::cin >> event;
        if(event == "HIT"){
            if(num_of_runner == 3)
                ++point;
            else
                ++num_of_runner;
        }
        else if(event == "HOMERUN"){
            point += 1 + num_of_runner;
            num_of_runner = 0;
        }
        else{
            ++num_of_out;
            if(num_of_out == 3)
                break;
    }
    
    return point;
}

int main()
{
    u_int num_of_inning;
    std::cin >> num_of_inning;
    
    for(u_int i = 0; i < num_of_inning; ++i){
        std::cout << Baseball() << std::endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int Baseball()':
a.cc:31:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   31 | int main()
      |         ^~
a.cc:31:9: note: remove parentheses to default-initialize a variable
   31 | int main()
      |         ^~
      |         --
a.cc:31:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:32:1: error: a function-definition is not allowed here before '{' token
   32 | {
      | ^
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
a.cc:41:2: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      |  ^
Language: C++

#include <iostream>
#include <string>
 
class Baseball
{
    u_int runner, out, point;
     
public:
    Baseball();
    ~Baseball(){}
         
    u_int get_out() const {return out;}
    u_int get_point() const {return point;}
    
    void game();
    void event_hit();
    void event_homerun();
    void event_out();
     
private:
    void set_runner(const u_int r) {runner = r;}
    void inc_runner() {++runner;}
    void inc_out() {++out;}
    void add_point(const u_int p) {point += p;}
};
 
Baseball::Baseball()
{
    runner = 0;
    out = 0;
    point = 0;
}

void Baseball::game()
{
    std::string event;
    while(get_out() != 3){
        std::cin >> event;
        if(event == "HIT"){
            event_hit();
        }
        else if(event == "HOMERUN"){
            event_homerun();
        }
        else{
            event_out();
        }
    }
} 

void Baseball::event_hit()
{
    if(get_runner() == 3){
        add_point(1);
    }
    else{
        inc_runner();
    }   
}
 
void Baseball::event_homerun()
{
    add_point(1 + get_runner());
    set_runner(0);
}
 
void Baseball::event_out()
{
    inc_out();
}
 
int main()
{
    u_int inning;
    std::cin >> inning;
     
    for(u_int i = 0; i < inning; ++i){
        Baseball b_ball;
        b_ball.game();
        std::cout << b_ball.get_point() << std::endl;
    }
 
    return 0;
}

Compiler output:
a.cc: In member function 'void Baseball::event_hit()':
a.cc:53:8: error: 'get_runner' was not declared in this scope; did you mean 'set_runner'?
   53 |     if(get_runner() == 3){
      |        ^~~~~~~~~~
      |        set_runner
a.cc: In member function 'void Baseball::event_homerun()':
a.cc:63:19: error: 'get_runner' was not declared in this scope; did you mean 'set_runner'?
   63 |     add_point(1 + get_runner());
      |                   ^~~~~~~~~~
      |                   set_runner
Language: C++

#include <iostream>
#include <queue>
#include <string>

class Baseball{
    private:
        std::queue<int> runner;
        int out_count;
        int score;
        
    public:
        void Baseball::initRunner(){
            while(runner.empty() != true){
                runner.pop();
            }
            for(int i = 0; i < 3; ++i){
                runner.push(0);
            }
        }
        
        Baseball(){
            out_count = 0;
            score = 0;
            initRunner();
        }
        
        ~Baseball(){}
        
        void Baseball::hit(){
            if(runner.front() == 1) ++score;
            runner.pop();
            runner.push(1);
        }
        
        void Baseball::homerun(){
            do{
                if(runner.front() == 1) ++score;
                runner.pop();
            } while (runner.empty() != true);
            ++score;
            initRunner();
        }
        
        int Baseball::getScore(){
            std::string str;
            while(out_count != 3){
                std::cin >> str;
                if(str == "HIT") hit();
                if(str == "HOMERUN") homerun();
                if(str == "OUT") ++out_count;
            }
            return score;
        }
};

int main(void){
    int N;
    std::cin >> N;
    for(int i = 0; i < N; ++i){
        Baseball baseball;
        std::cout << baseball.getScore() << std::endl;
    }
}

Compiler output:
a.cc:12:14: error: extra qualification 'Baseball::' on member 'initRunner' [-fpermissive]
   12 |         void Baseball::initRunner(){
      |              ^~~~~~~~
a.cc:29:14: error: extra qualification 'Baseball::' on member 'hit' [-fpermissive]
   29 |         void Baseball::hit(){
      |              ^~~~~~~~
a.cc:35:14: error: extra qualification 'Baseball::' on member 'homerun' [-fpermissive]
   35 |         void Baseball::homerun(){
      |              ^~~~~~~~
a.cc:44:13: error: extra qualification 'Baseball::' on member 'getScore' [-fpermissive]
   44 |         int Baseball::getScore(){
      |             ^~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
using namespace std;
int main(){
int n;
cin>>n;
rep(i,n){
int out=0;
int r1=0,r2=0,r3=0;
int tm=0;
while(out!=3){
char in[10];
cin>>in;
if(strcmp(in,"OUT")==0)out++;
if(strcmp(in,"HIT")==0){
if(r3==1){tm++;r3=0;}
if(r2==1){r3=1;r2=0;}
if(r1==1){r2=1;r1=0;}
r1++;
}
if(strcmp(in,"HOMERUN")==0){
if(r1==1){tm++;r1=0;}
if(r2==1){tm++;r2=0;}
if(r3==1){tm++;r3=0;}
tm++;
}
}
cout<<tm<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: 'strcmp' was not declared in this scope
   21 | if(strcmp(in,"OUT")==0)out++;
      |    ^~~~~~
a.cc:7:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<cmath>
  +++ |+#include <cstring>
    7 | #define pb(in,tmp) in.push_back(tmp)
a.cc:22:4: error: 'strcmp' was not declared in this scope
   22 | if(strcmp(in,"HIT")==0){
      |    ^~~~~~
a.cc:22:4: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:28:4: error: 'strcmp' was not declared in this scope
   28 | if(strcmp(in,"HOMERUN")==0){
      |    ^~~~~~
a.cc:28:4: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: Java

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
    main(chunk.trim());
});

function main(chunk){
    var lines = chunk.split("\n");
    for(var n=0;n<lines.length-1;){
        var H = Number(lines[n].split(" ")[0]);
        var W = Number(lines[n].split(" ")[1]);
        var map = [];
        n++;
        for(var i=0;i<H;i++){
            map[i] = lines[n].split("");
            n++;
        }
        console.log(calc(map,0,0));
    }
}
function calc(map,h,w){
    if(map[h][w] == "."){
        return w + " "+ h;
    }
    if(map[h][w] == "1"){
        return "LOOP";
    }
    switch(map[h][w]){
    case '>':
        map[h][w] = "1";
        return calc(map,h,w+1);
    case '<':
        map[h][w] = "1";
        return calc(map,h,w-1);
    case 'v':
        map[h][w] = "1";
        return calc(map,h+1,w);
    case '^':
        map[h][w] = "1";
        return calc(map,h-1,w);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
process.stdin.resume();
^
Main.java:2: error: class, interface, enum, or record expected
process.stdin.setEncoding('utf8');
^
Main.java:2: error: unclosed character literal
process.stdin.setEncoding('utf8');
                          ^
Main.java:2: error: unclosed character literal
process.stdin.setEncoding('utf8');
                               ^
Main.java:3: error: class, interface, enum, or record expected
process.stdin.on('data', function(chunk) {
^
Main.java:3: error: unclosed character literal
process.stdin.on('data', function(chunk) {
                 ^
Main.java:3: error: unclosed character literal
process.stdin.on('data', function(chunk) {
                      ^
Main.java:5: error: class, interface, enum, or record expected
});
^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
function main(chunk){
^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: <identifier> expected
function main(chunk){
                   ^
Main.java:12: error: illegal start of expression
        var map = [];
                  ^
Main.java:21: error: <identifier> expected
function calc(map,h,w){
                 ^
Main.java:21: error: <identifier> expected
function calc(map,h,w){
                   ^
Main.java:21: error: <identifier> expected
function calc(map,h,w){
                     ^
14 errors
Language: Java

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new MagicTiles().solve();
	}
	public void solve() {
		Scanner input = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int H, W;
		char[][] maze = new char[101][101];

		while (true) {
			String[] tmp = input.nextLine().split(" ");

			H = Integer.parseInt(tmp[0]);
			W = Integer.parseInt(tmp[1]);
			
			if(H == 0 && W == 0) break;

			for (int i = 0; i < H; i++) {				
					maze[i] = input.nextLine().toCharArray();
			}
			
			int ii = 0, jj = 0;
			
			while(maze[ii][jj] != '.' && maze[ii][jj] != 'X') {
				if(maze[ii][jj] == '>') { maze[ii][jj] = 'X'; jj += 1; continue; }
				if(maze[ii][jj] == '<') { maze[ii][jj] = 'X'; jj -= 1; continue; }
				if(maze[ii][jj] == '^') { maze[ii][jj] = 'X'; ii -= 1; continue; }
				if(maze[ii][jj] == 'v') { maze[ii][jj] = 'X'; ii += 1; continue; }
			}		
			if(maze[ii][jj] == 'X') {
				out.println("LOOP");
			} else {
				out.println(jj + " " + ii);
			}
		}
		input.close();
		out.close();
		System.exit(0);
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		new MagicTiles().solve();
		    ^
  symbol:   class MagicTiles
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
	int w,h;
	int[][] map;
	int[][] cost;
	int ansx, ansy;
	
	
	public void loop(int y, int x, int d){
		if(map[y][x]==0){
			System.out.println(x + " " + y);
			return;
		}
		
		cost[y][x] = 1;
		if(d==1){
			if(cost[y-1][x]==1){
				System.out.println("LOOP");
				return;
			}else{
				loop(y-1,x,map[y-1][x]);
			}
		}else if(d==2){
			if(cost[y][x+1]==1){
				System.out.println("LOOP");
				return;
			}else{
				loop(y,x+1,map[y][x+1]);
			}
		}else if(d==3){
			if(cost[y+1][x]==1){
				System.out.println("LOOP");
				return;
			}else{
				loop(y+1,x,map[y+1][x]);
			}
		}else if(d==4){
			if(cost[y][x-1]==1){
				System.out.println("LOOP");
				return;
			}else{
				loop(y,x-1,map[y][x-1]);
			}
		}
	
	}
	
	
	public static void main(String[] args) {
		AOJ_0104 A = new AOJ_0104();
		Scanner sc = new Scanner(System.in);
		
		while(true){
			A.h = sc.nextInt();
			A.w = sc.nextInt();
			if(A.h==0 && A.w==0)break;
			
			A.map = new int[A.h][A.w];
			A.cost = new int[A.h][A.w];
			
			for(int i=0;i<A.h;i++){
				String s = sc.next();
				for(int j=0;j<A.w;j++){
					String t = s.substring(j,j+1);
					if(t.compareTo("^")==0){
						A.map[i][j] = 1;
					}else if(t.compareTo(">")==0){
						A.map[i][j] = 2;
					}else if(t.compareTo("v")==0){
						A.map[i][j] = 3;
					}else if(t.compareTo("<")==0){
						A.map[i][j] = 4;
					}		
				}
			}
			A.loop(0, 0, A.map[0][0]);

		}
	}	
}

Compiler output:
Main.java:51: error: cannot find symbol
		AOJ_0104 A = new AOJ_0104();
		^
  symbol:   class AOJ_0104
  location: class Main
Main.java:51: error: cannot find symbol
		AOJ_0104 A = new AOJ_0104();
		                 ^
  symbol:   class AOJ_0104
  location: class Main
2 errors
Language: C

#include <cstdio>
#include <cstring>

using namespace std;

int main(){
	int n,m,k,l,b[105][105]={0};
	char a[105][105];
	while(1){
		scanf("%d %d ",&n,&m);
		if( n==0 && m==0 ) break;
		k=0; l=0;
		for(int i=0 ; i<n ; i++ ){
			scanf("%s",&a[i]);	
		}
		while(1){
			if(a[k][l]=='.'){
				printf("%d %d\n",l,k);
				break;
			}
			if(b[k][l]==1){
				printf("LOOP\n");
				break;
			}
			if(a[k][l]=='>'){
				b[k][l]=1;
				l++;
				continue;
			}
			if(a[k][l]=='v'){
				b[k][l]=1;
				k++;
				continue;
			}
			if(a[k][l]=='<' ){
				b[k][l]=1;
				l--;
				continue;
			}
			if(a[k][l]=='^' ){
				b[k][l]=1;
				k--;
				continue;
			}
		}
	}
	return 0;
}

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

#include <stdio.h>

#define RIGHT '>'
#define LEFT '<'
#define TOP '^'
#define UNDER 'v'
#define LOOP 'l'
#define END '.'
#define MAX 101

void dfs(char mp[MAX][MAX],int i,int j){
    if(mp[i][j]==END){
        printf("%d %d\n" ,j ,i);
        return;
    }
    if(mp[i][j]==LOOP){
        printf("LOOP\n");
        return;
    }
    
    if(mp[i][j]==RIGHT){
        mp[i][j] = LOOP;
        dfs(mp,i,j+1);
    }
    else if(mp[i][j]==LEFT){
        mp[i][j] = LOOP;
        dfs(mp,i,j-1);
    }
    else if(mp[i][j]==TOP){
        mp[i][j] = LOOP;
        dfs(mp,i-1,j);
    }
    else{
        mp[i][j] = LOOP;
        dfs(mp,i+1,j);
    }
}


int main(){
    char mp[MAX][MAX];
    int n,m;
    
    while(true){
        scanf("%d%d" ,&n ,&m);
        if(!n&&!m) break;
        
        for(int i = 0 ; i < n ; i++) scanf("%s" ,mp[i]);
        dfs(mp,0,0);
    }
    
    return 0;
}

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

#include<iosteram>
#include<string>

using namespace std;

int main(void){
	int w,h;
	while(cin>>>h>>w,h){
		string f[h];
		for(int i=0,i<h;i++){
			cin>>f[i];
		}	
		int x,y;
		x=y=0;
		bool used[h][w];
		memset(used,0,sizeof(used));
		while(true){
			if(used[y][x]){
				cout<<"LOOP"<<endl;
				break;
			}
			if(f[y][x]=='.'){
				cout<<x<<" "<<y<<endl;
				break;
			}
			used[y][x]=true;
		}
	
		switch(f[y][x]){
			case '>': x+=1; break;
			case '<': x-=1; break;
			case '^': y-=1; break;
			case 'v': y+=1; break;
		}
	}
}

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

#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <set>
using namespace std;
void calc(vector<vector<char> >, int y, int x);
int resultx;
int resulty;
set<string> passed;

int main() {
  while(true) {
  int width, height;
  cin >> width >> height;
  if(width == 0 && height == 0) break;
  vector<vector<char> > field(width, vector<char>(height));
  for(int w = 0; w < width; ++w) {
    for(int h = 0; h < height; ++h) {
      cin >> field[w][h];
    }
  }
  if(calc(field, 0, 0)) cout << resulty << " " << resultx << endl;
  }
  return 0;
}

bool calc(vector<vector<char> > field, int y, int x) {
  stringstream ss;
  ss << y << ',' << x;
  // cout << ss.str() << endl;
  if(passed.find(ss.str()) != passed.end()) {
    cout << "LOOP" << endl;
    return false;
  }
  passed.insert(ss.str());
  switch(field[x][y]) {
    case '>':
      calc(field, y + 1, x);
      break;
    case '<':
      calc(field, y - 1, x);
      break;
    case '^':
      calc(field, y, x - 1);
      break;
    case 'v':
      calc(field, y, x + 1);
      break;
    case '.':
      resultx = x;
      resulty = y;
      return true;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: could not convert 'calc(std::vector<std::vector<char> >(field), 0, 0)' from 'void' to 'bool'
   23 |   if(calc(field, 0, 0)) cout << resulty << " " << resultx << endl;
      |      ~~~~^~~~~~~~~~~~~
      |          |
      |          void
a.cc: At global scope:
a.cc:28:6: error: ambiguating new declaration of 'bool calc(std::vector<std::vector<char> >, int, int)'
   28 | bool calc(vector<vector<char> > field, int y, int x) {
      |      ^~~~
a.cc:7:6: note: old declaration 'void calc(std::vector<std::vector<char> >, int, int)'
    7 | void calc(vector<vector<char> >, int y, int x);
      |      ^~~~
a.cc: In function 'bool calc(std::vector<std::vector<char> >, int, int)':
a.cc:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
Language: C++

loop do
  n,m=gets.split.map(&:to_i)
  break if n==0
  px,py,cnt=0,0,0
  arr=Array.new()
  n.times do 
    arr<<gets.chomp.split("")
  end
  loop do
    case arr[py][px]
    when "<" then px-=1
    when ">" then px+=1
    when "^" then py-=1
    when "v" then py+=1
    else break
    end
    cnt+=1
    break if cnt>n*m
  end
  puts cnt>n*m ? "LOOP": "#{px} #{py}"
end

Compiler output:
a.cc:1:1: error: 'loop' does not name a type
    1 | loop do
      | ^~~~
Language: C++

int main(int argc, char **argv)
{
	int h, w;
	int x = 0, y = 0;
	char tiles[100][100];
	bool throughed[100][100] = {};
	bool loop = false;
	bool end = false;
	while(std::cin >> h >> w, h+w != 0){
		x = 0;
		y = 0;
		for(int i = 0; i < 100; i++){
			for(int j = 0; j < 100; j++){
				throughed[j][i] = false;
			}
		}
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				std::cin >> tiles[j][i];
			}
		}
		while(true){
			if(throughed[x][y]){
				loop = true;
				break;
			}
			throughed[x][y] = true;
			switch(tiles[x][y]){
				case '.':
					end = true;
					break;
				case '^':
					y--;
					break;
				case 'v':
					y++;
					break;
				case '<':
					x--;
					break;
				case '>':
					x++;
					break;
			}
			if(end){
				break;
			}
		}
		if(loop){
			std::cout << "LOOP" << std::endl;
		}else{
			std::cout << x << " " << y << std::endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:9:20: error: 'cin' is not a member of 'std'
    9 |         while(std::cin >> h >> w, h+w != 0){
      |                    ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(int argc, char **argv)
a.cc:19:38: error: 'cin' is not a member of 'std'
   19 |                                 std::cin >> tiles[j][i];
      |                                      ^~~
a.cc:19:38: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:50:30: error: 'cout' is not a member of 'std'
   50 |                         std::cout << "LOOP" << std::endl;
      |                              ^~~~
a.cc:50:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:50:53: error: 'endl' is not a member of 'std'
   50 |                         std::cout << "LOOP" << std::endl;
      |                                                     ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(int argc, char **argv)
a.cc:52:30: error: 'cout' is not a member of 'std'
   52 |                         std::cout << x << " " << y << std::endl;
      |                              ^~~~
a.cc:52:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:52:60: error: 'endl' is not a member of 'std'
   52 |                         std::cout << x << " " << y << std::endl;
      |                                                            ^~~~
a.cc:52:60: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
char s[101][101];
int n,m,a[100][100],c;
using namespace std;
void dfs(int y,int x){
  if(c)goto Z;
  if(a[y][x]++)goto L;
  if(s[y][x]=='.'){cout<<x<<' '<<y<<endl;p++;}
  else if(s[y][x]=='^')dfs(y-1,x);
  else if(s[y][x]=='v')dfs(y+1,x);
  else if(s[y][x]=='>')dfs(y,x+1);
  else if(s[y][x]=='<')dfs(y,x-1);
  L:cout<<"LOOP"<<endl;p++;Z:;
}
int main(){
  while(cin>>n>>m,n){c=0;
    rep(i,100)rep(j,100)a[i][j]=0;
    rep(i,n)rep(j,m)cin>>s[i][j];dfs(0,0);
  }
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:9:42: error: 'p' was not declared in this scope
    9 |   if(s[y][x]=='.'){cout<<x<<' '<<y<<endl;p++;}
      |                                          ^
a.cc:14:24: error: 'p' was not declared in this scope
   14 |   L:cout<<"LOOP"<<endl;p++;Z:;
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int a, b;

int main() {
	while (cin >> a >> b) {
		if (a == 0 && b == 0) {
			break;
		}
		char data[102][102];
		int b[a][b] = { 0 };
	      for(int i=0; i< a; i++){
	         for(int j=0; j< b; j++){
	            cin >> data[i][j];
	         }
	      }

		int H = 0, W = 0;
		int loop = 0;
		while (1) {
			if (data[H][W] == '<') {
				b[H][W] = 1;
				W -= 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}

			} else if (data[H][W] == '>') {
				b[H][W] = 1;
				W += 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}
			} else if (data[H][W] == 'v') {
				b[H][W] = 1;
				H += 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}
			} else if (data[H][W] == '^') {
				b[H][W] = 1;
				H -= 1;
				if (b[H][W] == 1) {
					loop = 1;
					break;
				}
			} else {
				break;
			}
		}
		if (loop != 1) {
			printf("%d %d\n", W, H);
		} else {
			printf("LOOP\n");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |                  for(int j=0; j< b; j++){
      |                               ~^~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <time.h>
#include<string>
using namespace std;
int main(){
	char tile[101][101];
	int dp[101][101]={0};
	bool finished=false;
	int x,y;
	while(1){
		cin>>y>>x;
		memset(dp,0,sizeof(dp));
		finished=false;
		if(y==0 && x==0){
			break;
		}
		for(int i=0;i<y;i++){
			for(int j=0;j<x;j++){
				cin>>tile[i][j];
			}
		}int i=0,j=0;
		while(1){
			switch(tile[i][j]){
			case '>': j++ ;dp[i][j]++;break;
			case '<': j--;dp[i][j]++;break;
			case '^': i--;dp[i][j]++;break;
			case 'v': i++;dp[i][j]++;break;
			case '.': cout<<j<<" "<<i<<endl;finished=true; break;
			}
			if(finished==true){
				break;
			}
			if(dp[i][j]==2){
				cout<<"LOOP"<<endl;
				break;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(dp,0,sizeof(dp));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <stdio.h>
Language: C++

#include <iostream>
#include <stdio.h>
#include <time.h>
#include<string>
using namespace std;
int main(){
	char tile[101][101];
	int dp[101][101]={0};
	bool finished=false;
	int x,y;
	while(1){
		cin>>y>>x;
		memset(dp,0,sizeof(dp)-1);
		finished=false;
		if(y==0 && x==0){
			break;
		}
		for(int i=0;i<y;i++){
			for(int j=0;j<x;j++){
				cin>>tile[i][j];
			}
		}int i=0,j=0;
		while(1){
			switch(tile[i][j]){
			case '>': j++ ;dp[i][j]++;break;
			case '<': j--;dp[i][j]++;break;
			case '^': i--;dp[i][j]++;break;
			case 'v': i++;dp[i][j]++;break;
			case '.': cout<<j<<" "<<i<<endl;finished=true; break;
			}
			if(finished==true){
				break;
			}
			if(dp[i][j]==2){
				cout<<"LOOP"<<endl;
				break;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(dp,0,sizeof(dp)-1);
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <stdio.h>
Language: C++

#include<stdio.h>
#include<windows.h>

char masu[101][101];
int H,W,x,y;



int main()
{
	int i,j;
	int f,t1,t2;
	char temp;
	
	for(;;){
		x=0;
		y=0;
		f=0;
		
		scanf("%d %d", &H, &W);
		if(H==0)break;
		scanf("%c",&temp);
		
		for(i=0;i<H;i++){
			for(j=0;j<W+1;j++){
				scanf("%c",&masu[i][j]);
			}
		}
		for(;;){
			if(masu[y][x]==','){
				f=1;
				break;
			}
			t1=x;
			t2=y;
			if(masu[y][x]=='>')x++;
			else if(masu[y][x]=='<')x--;
			else if(masu[y][x]=='v')y++;
			else if(masu[y][x]=='^')y--;
			else if(masu[y][x]=='.')break;
			masu[t2][t1]=',';
		}
		if(f==1)puts("LOOP");
		else printf("%d %d\n",x,y);
	}
	return 0;
}

Compiler output:
a.cc:2:9: fatal error: windows.h: No such file or directory
    2 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
	int w,h;
	string m[110];
	bool f[110][110], flag;
	
	while( cin >> h >> w , w, h ){
		flag = false;
		for(int y=0 ; y<h ; y++){
			m[y].clear();
			for(int x=0 ; x<w ; x++){
				f[y][x] = false;
			}
		}
		for(int y=0 ; y<h ; y++){
			cin >> m[y];
		}
		int x=0, y=0;
		while(1){
			if( m[y][x]=='>' ) x++;
			if( m[y][x]=='<' ) x--;
			if( m[y][x]=='v' ) y++;
			if( m[y][x]=='^' ) y--;
			
			if( m[y][x]=='.' || f[y][x] ){
				( f[y][x] )? flag = true : ;
				break;
			}
			f[y][x] = true;
		}
		(flag)? (cout << "LOOP" << endl) : (cout << x << " " << y << endl); 
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:60: error: expected primary-expression before ';' token
   29 |                                 ( f[y][x] )? flag = true : ;
      |                                                            ^
Language: C++

#include<iostream>
#include<vector>
#include<string>

using namespace std;

char f[101][101];
int judge[101][101];
int ex, ey;

void move(int i, int j)
{
	//printf("%3d:%3d\n", i, j);
	if(judge[i][j] == 1)
	{
		ex = -1; ey = -1;
		return;
	}
	else if(f[i][j] == '.')
	{
		ex = j; ey = i;
		returan;
	}

	judge[i][j] = 1;

	if(f[i][j] == '>')
	{
		move(i, j+1);
	}
	else if(f[i][j] == '<')
	{
		move(i, j-1);
	}
	else if(f[i][j] == '^')
	{
		move(i-1, j);
	}
	else if(f[i][j] == 'v')
	{
		move(i+1, j);
	}

}

int main()
{
	int w, h;
	while(cin >> h >> w)
	{
		if(h == 0 && w == 0) break;
		for(int i = 0; i < h; i++)
		{
			cin >> f[i];
		}
		/*
		   for(int i = 0; i < h; i++)
		   {
		   for(int j = 0; j < w; j++)
		   {
		   cout << f[i][j];
		   }
		   cout << endl;
		   }
		   */
		//cout << "Run" << endl;
		move(0, 0);
		//cout << "Finish" << endl;

		if(ex == -1 && ey == -1)
		{
			cout << "LOOP" << endl;
		}
		else
		{
			cout << ex << ' ' << ey << endl;
		}
	}
}

Compiler output:
a.cc: In function 'void move(int, int)':
a.cc:22:17: error: 'returan' was not declared in this scope
   22 |                 returan;
      |                 ^~~~~~~
Language: C++

#include<cstdio>
#include<algorithm>
#include<vector>
#include<iostream>
using namespace std;
int W,H;
char fie[102][102];
int cost[102][102];
char df[]={'>','v','<','^'};
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int main(){
  while(1){
    cin >> W >> H;
    memset(fie,-1,sizeof(fie));
    memset(cost,0,sizeof(cost));
    if(W==0 && H==0) break;
    for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
	cin >> fie[j][i];
      }
    }
    int x=0,y=0;
    bool f=false;
    cost[x][y]=1;
    while(fie[x][y]!='.'){
      for(int i=0;i<4;i++){
	
	if(fie[x][y]==df[i]){
	  x+=dx[i];
	  y+=dy[i];
	}
      }
      if(cost[x][y]){
	f=true;
	break;
      }
      cost[x][y]=1;
    }
    if(!f) printf("%d %d\n",x,y);
    else puts("LOOP");
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'memset' was not declared in this scope
   15 |     memset(fie,-1,sizeof(fie));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<iostream>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include<cstdio>
#include<algorithm>
#include<vector>
#include<iostream>
using namespace std;
int W,H;
char fie[102][102];
int cost[102][102];
char df[]={'>','v','<','^'};
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int main(){
  while(1){
    cin >> H >> W;
    memset(fie,-1,sizeof(fie));
    memset(cost,0,sizeof(cost));
    if(W==0 && H==0) break;
    for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
	cin >> fie[j][i];
      }
    }
    int x=0,y=0;
    bool f=false;
    cost[x][y]=1;
    while(fie[x][y]!='.'){
      for(int i=0;i<4;i++){
	
	if(fie[x][y]==df[i]){
	  x+=dx[i];
	  y+=dy[i];
	}
      }
      if(cost[x][y]){
	f=true;
	break;
      }
      cost[x][y]=1;
    }
    if(!f) printf("%d %d\n",x,y);
    else puts("LOOP");
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'memset' was not declared in this scope
   15 |     memset(fie,-1,sizeof(fie));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<iostream>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

int main(){
    int w,h;
    int ichi[101][101]={0};
    while(1){
        int i=0,j=0;
        cin >> w >> h;
        if(w == 0 && h == 0){
            break;
        }
        char map[w][h];
        for(int n=0;n<w;n++){
            for(int k=0;k<h;k++){
                cin >> map[n][k];
            }
        }
        while(1){
            for(int n=0;n<w;n++){
                memset(ichi[n],0,sizeof(ichi[i]));
            }
            if(ichi[i][j] == 1){
                cout << "LOOP" << endl;
                break;
            }
            else if(map[i][j] == '.'){
                cout << j << " " << i << endl;
                break;
            }
            if(map[i][j] == '>'){
                ichi[i][j] = 1;
                j++;
            }
            else if(map[i][j] == '<'){
                ichi[i][j] = 1;
                j--;
            }
            else if(map[i][j] == '^'){
                ichi[i][j] = 1;
                i--;
            }
            else if(map[i][j] == 'v'){
                ichi[i][j] = 1;
                i++;
            }
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'memset' was not declared in this scope
   21 |                 memset(ichi[n],0,sizeof(ichi[i]));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:48:6: error: expected '}' at end of input
   48 |     }
      |      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
    int w,h;
    int ichi[101][101]={0};
    while(1){
        int i=0,j=0;
        cin >> w >> h;
        if(w == 0 && h == 0){
            break;
        }
        char map[w][h];
        for(int n=0;n<w;n++){
            for(int k=0;k<h;k++){
                cin >> map[n][k];
            }
        }
        while(1){
            for(int n=0;n<w;n++){
                memset(ichi[n],0,sizeof(ichi[i]));
            }
            if(ichi[i][j] == 1){
                cout << "LOOP" << endl;
                break;
            }
            else if(map[i][j] == '.'){
                cout << j << " " << i << endl;
                break;
            }
            if(map[i][j] == '>'){
                ichi[i][j] = 1;
                j++;
            }
            else if(map[i][j] == '<'){
                ichi[i][j] = 1;
                j--;
            }
            else if(map[i][j] == '^'){
                ichi[i][j] = 1;
                i--;
            }
            else if(map[i][j] == 'v'){
                ichi[i][j] = 1;
                i++;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'memset' was not declared in this scope
   22 |                 memset(ichi[n],0,sizeof(ichi[i]));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>

int w,h;

int d[100][100];
char c;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

int main(){
	while( std::cin>>h>>w , (w || h) ){
		memset(d,-1,sizeof(d));
		for(int i=0;i<h;++i){
			for(int l=0;l<w;++l){
				std::cin>>c;
				if( c=='>' )
					d[l][i]=0;
				else if( c=='v' )
					d[l][i]=1;
				else if( c=='<' )
					d[l][i]=2;
				else if( c=='^' )
					d[l][i]=3;
			}
		}
		int Point[2]={0,0};
		while(1){
			if( d[Point[0]][Point[1]] == -1 ){
				break;
			}else if( d[Point[0]][Point[1]] < 4 ){
				int dnum=d[ Point[0] ][ Point[1] ];
				d[Point[0]][Point[1]]=4;
				Point[0]+=dx[ dnum ];
				Point[1]+=dy[ dnum ];
			}else{
				Point[0] = Point[1] = -1;
				break;
			}
		}
		if( Point[0]==-1 && Point[1]==-1 ){
			std::cout<<"LOOP"<<std::endl;
		}else{
			std::cout<<Point[0]<<" "<<Point[1]<<std::endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'memset' was not declared in this scope
   12 |                 memset(d,-1,sizeof(d));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define pb push_back
#define mp make_pair



int main(){
    typedef vector<string> vs;
    int h,w;
    while(cin>>h>>w, h|w){
        vs G(h);
        for(auto & a: G) cin>>a;

        vector<vector<bool>> vis(h, vector<bool>(w,false));
        int cx = 0, cy = 0;
        const int dx[] = {1,0,-1,0};
        const int dy[] = {0,-1,0,1};

        map<char,int> m;
        m['>'] = 0, m['^'] = 1, m['<'] = 2, m['v'] = 3;

        while(1){
            if(vis[cy][cs]){
                cout << "LOOP" << endl;
                goto end;
            }
            vis[cy][cx] = true;
            char c = G[cy][cx];
            if(c=='.'){
                cout << cx << " " << cy << endl;
                goto end;
            }
            cx += dx[m[c]], cy += dy[m[c]];
        }
    end:;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:24: error: 'cs' was not declared in this scope; did you mean 'cy'?
   38 |             if(vis[cy][cs]){
      |                        ^~
      |                        cy
Language: C++

#include<iostream>
using namespace std;

int main(){
   int a, b, i, j;
   char map[102][102]
   
   while(1){
      cin >> a >> b;
      if(a+b==0) break;
      
      for(i=0; i< a; i++){
         for(j=0; j< b; j++){
            cin >> map[i][j];
         }
      }
      i=0;j=0;
      while(1){
         if(map[i][j]=="."){
            cout << i << " " << j << endl;
         }else if(map[i][j]=="#"){
            cout << "loop" << endl;
         }else if(map[i][j]==">"){
            map[i][j]="#";
            j++;
         }else if(map[i][j]=="<"){
            map[i][j]="#";
            j--;
         }else if(map[i][j]=="^"){
            map[i][j]="#";
            i++;
         }else if(map[i][j]=="v"){
            map[i][j]="#";
            i--;
         }
      }
   }
   return 0;
   
   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:4: error: expected initializer before 'while'
    8 |    while(1){
      |    ^~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
   int a, b, i, j;
   char map[102][102];
   
   while(1){
      cin >> a >> b;
      if(a+b==0) break;
      
      for(i=0; i< a; i++){
         for(j=0; j< b; j++){
            cin >> map[i][j];
         }
      }
      i=0;j=0;
      while(1){
         if(map[i][j]=="."){
            cout << i << " " << j << endl;
            break;
         }else if(map[i][j]=="#"){
            cout << "loop" << endl;
            break;
         }else if(map[i][j]==">"){
            map[i][j]="#";
            j++;
         }else if(map[i][j]=="<"){
            map[i][j]="#";
            j--;
         }else if(map[i][j]=="^"){
            map[i][j]="#";
            i++;
         }else if(map[i][j]=="v"){
            map[i][j]="#";
            i--;
         }
      }
   }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |          if(map[i][j]=="."){
      |             ~~~~~~~~~^~~~~
a.cc:22:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |          }else if(map[i][j]=="#"){
      |                   ~~~~~~~~~^~~~~
a.cc:25:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |          }else if(map[i][j]==">"){
      |                   ~~~~~~~~~^~~~~
a.cc:26:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   26 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:28:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   28 |          }else if(map[i][j]=="<"){
      |                   ~~~~~~~~~^~~~~
a.cc:29:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   29 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:31:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |          }else if(map[i][j]=="^"){
      |                   ~~~~~~~~~^~~~~
a.cc:32:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   32 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:34:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |          }else if(map[i][j]=="v"){
      |                   ~~~~~~~~~^~~~~
a.cc:35:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   35 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
Language: C++

#include<iostream>
using namespace std;

int main(){
   int a, b, i, j;
   char map[102][102];
   
   while(1){
      cin >> a >> b;
      if(a+b==0) break;
      
      for(i=0; i< a; i++){
         for(j=0; j< b; j++){
            cin >> map[i][j];
         }
      }
      i=0;j=0;
      while(1){
         if(map[i][j]=='.'){
            cout << i << " " << j << endl;
            break;
         }else if(map[i][j]=='#'){
            cout << "loop" << endl;
            break;
         }else if(map[i][j]=='>'){
            map[i][j]="#";
            j++;
         }else if(map[i][j]=='<'){
            map[i][j]="#";
            j--;
         }else if(map[i][j]=='^'){
            map[i][j]="#";
            i++;
         }else if(map[i][j]=='v'){
            map[i][j]="#";
            i--;
         }
      }
   }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   26 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:29:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   29 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:32:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   32 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:35:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   35 |             map[i][j]="#";
      |                       ^~~
      |                       |
      |                       const char*
Language: C++

#include<iostream>
using namespace std;
int main(void)
{
  int h,w;
  while(true)
    {
      cin>>h>>w;
      if(h==0 && w==0)break;
      char str[h][w];
      int looper[h][w];
      for(int i=0;i<h;i++)
	{
	  for(int j=0;j<w;j++)
	    {
	      cin>>str[i][j];
	      looper[i][j]=0;
	    }
	}
      int i=0,j=0;
      
      while(true)
	{
	  if(str[i][j]=='>')
	    {
	      
	      j++;
	    }
	  else if(str[i][j]=='<')
	    {
	      j--;
	      
	    }
	  else if(str[i][j]=='v')
	    {
	      i++;
	    }
	  else 
	    {
	      i--;
	    }
	  
	  if(str[i][j]=='.')
	    {
	      cout<<j<<" "<<i<<endl;
	      break;
	    }
	  else if(looper[i][j]==1)
	    {
	      cout<<"LOOP"<<endl;
	      break;
	    }
	  
	  loop[i][j]++;
	}
 
    }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:11: error: 'loop' was not declared in this scope; did you mean 'looper'?
   54 |           loop[i][j]++;
      |           ^~~~
      |           looper
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class Main {

	private BufferedReader in = new BufferedReader(new InputStreamReader(
			System.in));

	public static void main(String[] args) {
		BookIndex wordcount = new BookIndex();
		String[] words = wordcount.input();
		Map<String, ArrayList<Integer>> entries = wordcount.count(words);
		wordcount.print(entries);
	}

	/**
	 * 出現位置を保存
	 */
	private Map<String, ArrayList<Integer>> count(String[] entries) {
		Map<String, ArrayList<Integer>> map = new TreeMap<String, ArrayList<Integer>>();
		for (int i = 0; i < entries.length; i += 2) {
			if (entries[i].equals(""))
				continue;
			List<Integer> index;
			if ((index = map.get(entries[i])) == null) {
				ArrayList<Integer> list = new ArrayList<Integer>();
				list.add(Integer.parseInt(entries[i + 1]));
				map.put(entries[i], list);
			} else {
				index.add(Integer.parseInt(entries[++i]));
			}
		}
		return map;
	}

	/**
	 * 単語＋改行＋indexで出力
	 */
	private void print(Map<String, ArrayList<Integer>> map) {
		for (String str : map.keySet()) {
			List<Integer> list = map.get(str);
			System.out.print(str + "\n" + list.get(0));
			for (int i = 1; i < list.size(); i++) {
				System.out.print(" " + list.get(i));
			}
			System.out.println();
		}
	}

	/**
	 * 標準入力から読み込んだ文字列を空白区切りで分割
	 */
	private String[] input() {
		String str = null;
		try {
			str = in.readLine();
			while (true) {
				String input = in.readLine();
				if (input == null)
					break;
				str = str + " " + input;
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (str == null)
			return new String[0];
		else
			return str.toLowerCase().split("\\s+");
	}
}

Compiler output:
Main.java:15: error: cannot find symbol
		BookIndex wordcount = new BookIndex();
		^
  symbol:   class BookIndex
  location: class Main
Main.java:15: error: cannot find symbol
		BookIndex wordcount = new BookIndex();
		                          ^
  symbol:   class BookIndex
  location: class Main
2 errors