Language: C++

#include<iostream>
#include<algorithm>
#include<numeric>
#include<iterator>
#include<vector>

using namespace std;
typedef unsigned int val;

int tate(char mass[256][256],int n)
{
	int count=0,a=0,b=0,ans=-1;
	
	while(1)
	{

		if(b==n)break;
		
		if(mass[a][b]=='0' || a==n)
		{ 
			
			if(ans<count) ans=count;

			a=0;b++;count=0;continue; 

		}
		
		a++;count++;

	}
	return ans;
}

int yoko(char mass[256][256],int n)
{
	int count=0,a=0,b=0,ans=-1;
	
	while(1)
	{

		if(a==n)break;
		
		if(mass[a][b]=='0' || b==n)
		{ 
			
			if(ans<count) ans=count;

			b=0;a++;count=0;continue; 

		}
		
		b++;count++;

	}
	return ans;
}


int main() 
{
	int n;
	while(cin>>n && n)
	{
		char mass[260][260];
		
		for(int i=0; i<n; i++) cin >> mass[i];

		int ans=-1;

		if( ans < tate( mass, n ) ) ans = tate( mass, n );
		if( ans < yoko( mass, n ) ) ans = yoko( mass, n );
		
		for(int i=0; i<n ;i++)
		{
			for(int j=0; j<n; j++)
			{
				
				if(mass[i][j]=='1')
				{
					int a=i,b=j,count=0;
					while(1)
					{
						if( mass[a][b] == '0' || b<0 || n<a) break;
						mass[a][b]='0';
						count++;
						a++;b--;
						if(b==n){ a++;b=n-1; }
					}
					if(ans<count) ans=count;
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:33: error: cannot convert 'char (*)[260]' to 'char (*)[256]'
   70 |                 if( ans < tate( mass, n ) ) ans = tate( mass, n );
      |                                 ^~~~
      |                                 |
      |                                 char (*)[260]
a.cc:10:15: note:   initializing argument 1 of 'int tate(char (*)[256], int)'
   10 | int tate(char mass[256][256],int n)
      |          ~~~~~^~~~~~~~~~~~~~
a.cc:70:57: error: cannot convert 'char (*)[260]' to 'char (*)[256]'
   70 |                 if( ans < tate( mass, n ) ) ans = tate( mass, n );
      |                                                         ^~~~
      |                                                         |
      |                                                         char (*)[260]
a.cc:10:15: note:   initializing argument 1 of 'int tate(char (*)[256], int)'
   10 | int tate(char mass[256][256],int n)
      |          ~~~~~^~~~~~~~~~~~~~
a.cc:71:33: error: cannot convert 'char (*)[260]' to 'char (*)[256]'
   71 |                 if( ans < yoko( mass, n ) ) ans = yoko( mass, n );
      |                                 ^~~~
      |                                 |
      |                                 char (*)[260]
a.cc:34:15: note:   initializing argument 1 of 'int yoko(char (*)[256], int)'
   34 | int yoko(char mass[256][256],int n)
      |          ~~~~~^~~~~~~~~~~~~~
a.cc:71:57: error: cannot convert 'char (*)[260]' to 'char (*)[256]'
   71 |                 if( ans < yoko( mass, n ) ) ans = yoko( mass, n );
      |                                                         ^~~~
      |                                                         |
      |                                                         char (*)[260]
a.cc:34:15: note:   initializing argument 1 of 'int yoko(char (*)[256], int)'
   34 | int yoko(char mass[256][256],int n)
      |          ~~~~~^~~~~~~~~~~~~~