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

PROGRAMMING:Fire brigade captain Porcupine

Luz5年前 (2021-05-10)题库467
There is a fire in an n * n area. Each fire area needs a fireman. The captain porcupine assigns members to fight the fire. How many firemen do you need?
###Input format:
The length of the first line input region n (1 < = n < = 100)
Then enter the number of N rows and N columns, only 0 or 1, 0 means no fire, 1 means fire.
###Output format:
How many firefighters are needed for the output. The form is as follows: if only one fireman is needed, output "need 1 firefighter". "., If there is more than one or no fire, output "need x firefighters".
###Input example:
Here is a set of inputs. For example:
```in
two
1 0
0 1
three
1 1 0
0 0 1
0 0 1
```
###Output example:
The corresponding output is given here. For example:
```out
need 2 Firefighters
need 4 Firefighters
```







answer:If there is no answer, please comment