meili 发表于 2022-10-27 15:45:22

ProblemDescriptionWedividetheHZNUCampusintoN*Mgrids.Asyoucanseefromthepicturebelow,thegreengridsrepresentthebuidings.GiventhesizeoftheHZNUCampus,andthecolorofeachgrid,youshouldcounthowmanygreengridsin

<p>问题:ProblemDescriptionWedividetheHZNUCampusintoN*Mgrids.Asyoucanseefromthepicturebelow,thegreengridsrepresentthebuidings.GiventhesizeoftheHZNUCampus,andthecolorofeachgrid,youshouldcounthowmanygreengridsintheN*Mgri
<p>答案:↓↓↓<p class="nav-title mt10" style="border-top:1px solid #ccc;padding-top: 10px;">宫大的回答:<div class="content-b">网友采纳  额,这个好像也没什么啊,不知道是不是理解错误,英语不是很好.  首先要求输入一个整数,表示数组个数,第三行的数据表示的是第一个数组的维数,同时对数组进行初始化,由1或者0来表示是否有建筑物.然后进行第二个数组的操作.  最后的输出结果就是每个数组中元素为1的个数.
页: [1]
查看完整版本: ProblemDescriptionWedividetheHZNUCampusintoN*Mgrids.Asyoucanseefromthepicturebelow,thegreengridsrepresentthebuidings.GiventhesizeoftheHZNUCampus,andthecolorofeachgrid,youshouldcounthowmanygreengridsin