建个企业网站一年多少钱,建设银行网站点不进去了怎么办,苏州网站建设系统价格合理,无障碍浏览网站怎么做题意 OIBH被突来的洪水淹没了.还好OIBH总部有在某些重要的地方起一些围墙#xff0c;用*号表示#xff0c;而一个封闭的*号区域洪水是进不去的……现在给出OIBH的围墙建设图#xff0c;问OIBH总部没被淹到的重要区域#xff08;由0表示#xff09;有多… 题意 OIBH被突来的洪水淹没了.还好OIBH总部有在某些重要的地方起一些围墙用*号表示而一个封闭的*号区域洪水是进不去的……现在给出OIBH的围墙建设图问OIBH总部没被淹到的重要区域由0表示有多少。 分析 做法周围一圈撒“种子”然后将能蔓延的全部遍历掉就行了 var zfc:ansistring; i,j,x,y,tj:longint; a:array[-1..501,-1..501]of char; procedure s(i,j:longint); var w:longint; begin if a[i,j]0 then a[i,j]:1 else exit; s(i1,j); s(i-1,j); s(i,j1); s(i,j-1); end; begin while not eof(input) do begin read(zfc); readln; inc(i); for j:1 to length(zfc) do a[i,j]:zfc[j]; y:length(zfc); end; x:i; for i:1 to x do begin if a[i,1]0 then s(i,1); if a[i,y]0 then s(i,y); end; for i:1 to y do begin if a[1,i]0 then s(1,i); if a[x,i]0 then s(x,i); end; for i:1 to x do for j:1 to y do if a[i,j]0 then inc(tj); writeln(tj); end. 转载于:https://www.cnblogs.com/YYC-0304/p/9500153.html