求帮忙分析一下函数结构
#include <stdio.h>int Put ( int x, int y );
void Out ( int a, int b );
char z[10][10];
int n, max;
int main()
{
int i;
while( scanf( "%d", &n ) != EOF )
{
if( n == 0 )
break;
for( i = 0; i < n; i++ )
scanf( "%s", z[i] );
max = 0;
Out(0,0);
printf( "%d\n", max );
}
}
int Put( int x, int y )
{
int i;
if( z[x][y] != '.' )
return 0;
for( i = x-1; i >= 0; i-- )
{
if( z[i][y] == 'X' )
break;
if( z[i][y] == '0' )
return 0;
}
for( i = y-1; i >= 0; i-- )
{
if( z[x][i] == 'X' )
break;
if( z[x][i] == '0' )
return 0;
}
return 1;
}
void Out ( int a, int b )
{
int x, y;
if( a >= n*n )
{
if( max < b ) max = b;
return;
}
x = a / n;
y = a % n;
if( Put( x, y ) == 1 )
{
z[x][y] = '0';
Out( a+1, b+1 );
[color=#00FF00]z[x][y] = '.';
}
Out( a+1, b );
}
[/color]