5914: K7-6-4 猴群
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
给出一个由数字0~9组成的矩形,其中数字0代表树,1~9代表猴子,凡是由0或矩形边围起来的区域表示有一群猴子在这一带。编程求矩形中有多少群猴子。
Input
第一行两个正整数,表示矩形的行数m和列数n,1≤m,n≤100;
下面为一个m x n的数字矩形
Output
一行一个数,表示猴群的数目。
Sample Input Copy
4 10
0234500067
1034560500
2045600671
0000000089
Sample Output Copy
4