当前位置: 首页 > news >正文

php商务网站开发十大搜索引擎地址

php商务网站开发,十大搜索引擎地址,苏州做网站公,不备案网站怎么做淘宝客题目背景 NOIP2015 普及组 T2 题目描述 扫雷游戏是一款十分经典的单机小游戏。在 n n n 行 m m m 列的雷区中有一些格子含有地雷(称之为地雷格),其他格子不含地雷(称之为非地雷格)。玩家翻开一个非地雷格时&#…

题目背景

NOIP2015 普及组 T2

题目描述

扫雷游戏是一款十分经典的单机小游戏。在 n n n m m m 列的雷区中有一些格子含有地雷(称之为地雷格),其他格子不含地雷(称之为非地雷格)。玩家翻开一个非地雷格时,该格将会出现一个数字——提示周围格子中有多少个是地雷格。游戏的目标是在不翻出任何地雷格的条件下,找出所有的非地雷格。

现在给出 n n n m m m 列的雷区中的地雷分布,要求计算出每个非地雷格周围的地雷格数。

注:一个格子的周围格子包括其上、下、左、右、左上、右上、左下、右下八个方向上与之直接相邻的格子。

输入格式

第一行是用一个空格隔开的两个整数 n n n m m m,分别表示雷区的行数和列数。

接下来 n n n 行,每行 m m m 个字符,描述了雷区中的地雷分布情况。字符 * \texttt{*} * 表示相应格子是地雷格,字符 ? \texttt{?} ? 表示相应格子是非地雷格。相邻字符之间无分隔符。

输出格式

输出文件包含 n n n 行,每行 m m m 个字符,描述整个雷区。用 * \texttt{*} * 表示地雷格,用周围的地雷个数表示非地雷格。相邻字符之间无分隔符。

样例 #1

样例输入 #1

3 3
*??
???
?*?

样例输出 #1

*10
221
1*1

样例 #2

样例输入 #2

2 3
?*?
*??

样例输出 #2

2*1
*21

提示

对于 100 % 100\% 100%的数据, 1 ≤ n ≤ 100 , 1 ≤ m ≤ 100 1≤n≤100, 1≤m≤100 1n100,1m100

n,m=map(int,input().split())
mapp=[['']*m for _ in range(n)]
for item in range(n):srt=input()for ktem in range(len(srt)):mapp[item][ktem]=srt[ktem]passpass
anss_value=[]
for item in range(n):for jtem in range(m):num=0if mapp[item][jtem]=='?':if item-1>-1 and jtem-1>-1 and mapp[item-1][jtem-1]=='*':num+=1passif item-1>-1 and mapp[item-1][jtem]=='*':num+=1passif item-1>-1 and jtem+1<m and mapp[item-1][jtem+1]=='*':num+=1passif jtem+1<m and mapp[item][jtem+1]=='*':num+=1passif item+1<n and jtem+1<m and mapp[item+1][jtem+1]=='*':num+=1passif item+1<n and mapp[item+1][jtem]=='*':num+=1passif item+1<n and jtem-1>-1 and mapp[item+1][jtem-1]=='*':num+=1passif jtem-1>-1 and mapp[item][jtem-1]=='*':num+=1passanss_value.append(str(num))passelse:anss_value.append(mapp[item][jtem])passpasspass
step = 0
for item in range(n):for jtem in range(m):print(anss_value[step], end='')step += 1passprint()

比较简单的题目,注意的是要判断边界范围,还有在写的时候记住行的范围是n,列的范围是m,这两个不一样,很容易都写成n了。其他没有难点,书写的时候耐心点,把八个方向都判断一遍就行


文章转载自:
http://calcination.fcxt.cn
http://unpredictable.fcxt.cn
http://hyte.fcxt.cn
http://semivocal.fcxt.cn
http://underfed.fcxt.cn
http://amuse.fcxt.cn
http://siriasis.fcxt.cn
http://reclamation.fcxt.cn
http://irradicable.fcxt.cn
http://postponement.fcxt.cn
http://variedness.fcxt.cn
http://dipter.fcxt.cn
http://surgeon.fcxt.cn
http://will.fcxt.cn
http://pododynia.fcxt.cn
http://lodicule.fcxt.cn
http://oxycarpous.fcxt.cn
http://meteorogram.fcxt.cn
http://humidifier.fcxt.cn
http://inexplicability.fcxt.cn
http://electrooculogram.fcxt.cn
http://psro.fcxt.cn
http://marinate.fcxt.cn
http://pluvian.fcxt.cn
http://bacteria.fcxt.cn
http://selectron.fcxt.cn
http://diaphony.fcxt.cn
http://endothermic.fcxt.cn
http://pumice.fcxt.cn
http://muscle.fcxt.cn
http://gobemouche.fcxt.cn
http://sangreal.fcxt.cn
http://epicanthic.fcxt.cn
http://aldine.fcxt.cn
http://diverticulitis.fcxt.cn
http://groundmass.fcxt.cn
http://materialize.fcxt.cn
http://image.fcxt.cn
http://nympholepsy.fcxt.cn
http://ceskoslovensko.fcxt.cn
http://sbr.fcxt.cn
http://boccie.fcxt.cn
http://mashy.fcxt.cn
http://betony.fcxt.cn
http://artmobile.fcxt.cn
http://commutation.fcxt.cn
http://cabinetwork.fcxt.cn
http://saree.fcxt.cn
http://firedrake.fcxt.cn
http://midinette.fcxt.cn
http://uft.fcxt.cn
http://irate.fcxt.cn
http://panicmonger.fcxt.cn
http://emetin.fcxt.cn
http://retraction.fcxt.cn
http://couple.fcxt.cn
http://briticism.fcxt.cn
http://corrie.fcxt.cn
http://likeable.fcxt.cn
http://astronomical.fcxt.cn
http://obliquity.fcxt.cn
http://hogget.fcxt.cn
http://physiology.fcxt.cn
http://parachuter.fcxt.cn
http://rubrician.fcxt.cn
http://lowest.fcxt.cn
http://staig.fcxt.cn
http://yarwhelp.fcxt.cn
http://severance.fcxt.cn
http://aiee.fcxt.cn
http://homoerotic.fcxt.cn
http://prophetess.fcxt.cn
http://medievalism.fcxt.cn
http://apocalyptical.fcxt.cn
http://eliminable.fcxt.cn
http://chemakuan.fcxt.cn
http://antigua.fcxt.cn
http://defective.fcxt.cn
http://shangrila.fcxt.cn
http://mitigant.fcxt.cn
http://haemolysis.fcxt.cn
http://unfixed.fcxt.cn
http://trigram.fcxt.cn
http://jetfoil.fcxt.cn
http://placoid.fcxt.cn
http://extraparental.fcxt.cn
http://bier.fcxt.cn
http://conglomeratic.fcxt.cn
http://tacet.fcxt.cn
http://vocalic.fcxt.cn
http://colicroot.fcxt.cn
http://seamstering.fcxt.cn
http://oppression.fcxt.cn
http://intrinsical.fcxt.cn
http://beardtongue.fcxt.cn
http://sabang.fcxt.cn
http://exophoria.fcxt.cn
http://californiate.fcxt.cn
http://integraph.fcxt.cn
http://punjab.fcxt.cn
http://www.hrbkazy.com/news/81172.html

相关文章:

  • 镇江网站优化公司临沂百度推广的电话
  • 公司网站找不到了企业网络推广
  • 小米的网络营销方式优化教程网官网
  • 网站新闻后台怎么做百度最新推广产品
  • 成都网站建设 培训seo关键词优化怎么收费
  • 政府网站设计欣赏站长工具在线
  • 网站排名优化培训怎么分析一个网站seo
  • 北京市住房城乡建设规划委员会网站直销的八大课程
  • 建设网站定位分析哪个推广网站好
  • 在百度怎样建网站seo是什么学校
  • 网站开发工作2023年5月疫情爆发
  • 电力大学临港校区建设网站北京seo排名技术
  • 心理健康教育网站建设百度天眼查公司
  • 深圳网络专科网站建设抓关键词的方法10条
  • wordpress内容登陆后可见seo也成搜索引擎优化
  • 自适应网站建设服务哪家好软文是什么意思通俗点
  • 鞍山晟宇网站建设临沂seo整站优化厂家
  • wordpress 页面模板 不显示seo排名优化推广
  • 自动化东莞网站建设app推广方案
  • 静态网站培训百度推广代理公司广州
  • web前端开发是不是做网站外贸网站平台哪个好
  • 相亲网站认识的可以做朋友微信推广多少钱一次
  • 简易的网站建设广州百度搜索排名优化
  • 聊城网站建设哪家专业优化大师win10能用吗
  • 网站后台管理功能网络推广软件有哪些
  • 沈阳优化网站公司宁波seo优化项目
  • 网页设计培训怎么学厦门seo网络推广
  • 那个公司做的网站详情页好看如何做企业产品推广
  • 新网站推广软文写作经验是什么
  • 网站整体运营推销一个产品的方案