-->
当前位置:首页 > 题库

PROGRAMMING:Tumor area

Luz5年前 (2021-05-10)题库529
###Task description
In a square gray image, the tumor is a rectangular area, the edge of the tumor pixel in the image is represented by 0. Other points inside and outside the tumor are represented by 255. Now you are required to write a program to calculate the number of pixels inside the tumor (excluding the points on the edge of the tumor). The edge of the tumor is known to be parallel to the edge of the image.
###Input format:
There is only one test sample. The first line has an integer n, which represents the side length of the square image. After n lines, each line has n integers, and the value is 0 or 255. Integers are separated by a space. It is known that n is not more than 1000.
###Output format:
Output a line, which contains an integer for the number of pixels in the tumor.
###Input example:
```in
five
255 255 255 255 255
255 0 0 0 255
255 0 255 0 255
255 0 0 0 255
255 255 255 255 255
```
###Output example:
```out
one
```
###Title Source
This topic is selected from openjudge website http://noi.openjudge.cn/ch0108/18/







answer:If there is no answer, please comment