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

PROGRAMMING:Find the number of surrounded zeros

Luz5年前 (2021-05-10)题库454
Program to calculate the area of the following figure enclosed by asterisk "*". The area calculation method is to count the number of intersection points of horizontal and vertical lines in the closed curve enclosed by asterisk "*". In the figure below, at 10 × In the two-dimensional array of 10, there are 15 points surrounded by "*", so the area is 15.
![ Week 7_ Question 1_ Fig. PNG] (~ / be6d32e4-2a6e-42de-848d-3fc5d4527b27. PNG)
###Input format:
A total of 10 lines, each line of 10 characters separated by spaces, the character is one of '0' or '*'
###Output format:
One number is the area enclosed by "*"
###Input example:
Here is a set of inputs. For example:
```in
0 0 0 0 0 0 0 0 0 0
0 0 0 0 * * * 0 0 0
0 0 0 0 * 0 0 * 0 0
0 0 0 0 0 * 0 0 * 0
0 0 * 0 0 0 * 0 * 0
0 * 0 * 0 * 0 0 * 0
0 * 0 0 * * 0 * * 0
0 0 * 0 0 0 0 * 0 0
0 0 0 * * * * * 0 0
0 0 0 0 0 0 0 0 0 0
```
###Output example:
The corresponding output is given here. For example:
```out
fifteen
```







answer:If there is no answer, please comment