Problem Description

Problem Description
We divide the HZNU Campus into N*M grids.As you can see from the picture below,the green grids represent the buidings.Given the size of the HZNU Campus,and the color of each grid,you should count how many green grids in the N*M grids.
Input
Standard input will contain multiple test cases.The first line of the input is a single integer T which is the number of test cases.T test cases follow.
The first line of each test case contains two integers n and m(1
名字好难找啊 1年前 已收到1个回答 举报

爱就3个字 幼苗

共回答了24个问题采纳率:91.7% 举报

额,这个好像也没什么啊,不知道是不是理解错误,英语不是很好.
首先要求输入一个整数,表示数组个数,第三行的数据表示的是 第一个数组的 维数,同时对数组进行初始化,由 1 或者0 来表示是否有建筑物.然后进行第二个数组的操作.
最后的输出结果就是 每个数组中 元素为 1 的个数.

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.041 s. - webmaster@yulucn.com