问题2543--White Rectangles

2543: White Rectangles

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

You are given a chessboard made up of N squares by N squares with equal size. Some of the squares are colored black, and the others are colored white. Please write a program to calculate the number of rectangles which are completely made up of white squares.

输入

There are multiple test cases. Each test case begins with an integer N (1 <= N <= 100), the board size. The following N lines, each with N characters, have only two valid character values: # - (sharp) representing a black square; . - (point) representing a white square. Process to the end of file.

输出

For each test case in the input, your program must output the number of white rectangles, as shown in the sample output.

样例输入 Copy

2
.#
..
4
..#.
##.#
.#..
.#.#

样例输出 Copy

5
15

来源/分类