Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	int h,w;
	while(cin>>h>>w,w||h){
		string a;
		for(int i=0;i<w;i++){
			for(int j=0;j<h;j++){
				cin>>a[i][j];
			}
		}
		bool flag=true;
		int i=0,j=0;
		while(flag){
			flag=true;
			if(a[i][j]=='v'){
				i++;
				a[i][j]='!';
			}
			if(a[i][j]=='>'){
				j++;
				a[i][j]='!';
			}
			if(a[i][j]=='<'){
				j--;
				a[i][j]='!';
			}
			if(a[i][j]=='^'){
				i--;
				a[i][j]='!';
			}
			if(a[i][j]=='.'){
				break;
			}
			if(a[i][j]=='!'){
				flag=false;
			}
		}
		if(!flag){
			cout<<"LOOP"<<endl;
		}
		else{
			cout<<j<<' '<<i<<endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:42: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   10 |                                 cin>>a[i][j];
      |                                          ^
a.cc:17:32: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   17 |                         if(a[i][j]=='v'){
      |                                ^
a.cc:19:37: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   19 |                                 a[i][j]='!';
      |                                     ^
a.cc:21:32: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   21 |                         if(a[i][j]=='>'){
      |                                ^
a.cc:23:37: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   23 |                                 a[i][j]='!';
      |                                     ^
a.cc:25:32: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   25 |                         if(a[i][j]=='<'){
      |                                ^
a.cc:27:37: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   27 |                                 a[i][j]='!';
      |                                     ^
a.cc:29:32: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   29 |                         if(a[i][j]=='^'){
      |                                ^
a.cc:31:37: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   31 |                                 a[i][j]='!';
      |                                     ^
a.cc:33:32: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   33 |                         if(a[i][j]=='.'){
      |                                ^
a.cc:36:32: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   36 |                         if(a[i][j]=='!'){
      |                                ^