public
static
void
Test(
int
m,
int
n)
{
int count = 0 ;
for ( int x = 0 ; x <= m - 1 ; x ++ )
{
for ( int y = 0 ; y <= n - 1 ; y ++ )
{
// x,y为左下顶点座标
for ( int i = x + 1 ; i <= m; i ++ )
{
for ( int j = y + 1 ; j <= n; j ++ )
{
// i,j为矩形右上点座标
count ++ ;
}
}
}
}
Console.WriteLine(count);
}
{
int count = 0 ;
for ( int x = 0 ; x <= m - 1 ; x ++ )
{
for ( int y = 0 ; y <= n - 1 ; y ++ )
{
// x,y为左下顶点座标
for ( int i = x + 1 ; i <= m; i ++ )
{
for ( int j = y + 1 ; j <= n; j ++ )
{
// i,j为矩形右上点座标
count ++ ;
}
}
}
}
Console.WriteLine(count);
}