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

地方生活门户网站wordpress 上传文章

地方生活门户网站,wordpress 上传文章,福田区龙岗区发布通告,徐州seo公司CSTL之Map容器 - 数据结构教程 - C语言网 (dotcpp.com)https://www.dotcpp.com/course/118CSTL之Pair类模板 - 数据结构教程 - C语言网 (dotcpp.com)https://www.dotcpp.com/course/119 刷到一个扫雷的题目#xff0c;之前没有玩怎么过扫雷#xff0c;于是我就去玩了玩…CSTL之Map容器 - 数据结构教程 - C语言网 (dotcpp.com)https://www.dotcpp.com/course/118CSTL之Pair类模板 - 数据结构教程 - C语言网 (dotcpp.com)https://www.dotcpp.com/course/119        刷到一个扫雷的题目之前没有玩怎么过扫雷于是我就去玩了玩一玩就凌晨两点直接上瘾好几天哈哈。 言归正传瞅瞅这道编程题不难用pair表示坐标mappairint,int,int关联容器存储各坐标点状态key-2维坐标value-地雷状态0/1然后迭代器遍历map地雷阵计算当前坐标点处四周8个位置的地雷数注意地雷矩阵边缘处的邻近区域的特殊性可以通过map的find()成员函数的返回值鉴定输出。 #includeiostream #includemap #includevector using namespace std;void mineSweeper(const mappairint,int,int sweeper, vectorint sweeper_size){for(auto itsweeper.begin(); it!sweeper.end(); it){// sweeperif(it-second 1){cout*;}// not sweeper, count sweeper_num aroundelse{int sweeper_sum0;for(int i-1; i1; i){for(int j-1; j1; j){int locs_1 it-first.first i;int locs_2 it-first.second j;if(sweeper.find(make_pair(locs_1,locs_2)) ! sweeper.end()){// cout(locs_1,locs_2);sweeper_sum sweeper.find(make_pair(locs_1,locs_2))-second;// coutsweeper_sum;}}}coutsweeper_sum;}if(it-first.second sweeper_size[1]){coutendl;}} }int main() {int num 0;while(1){num;// inputpairint,int locs;char input;mappairint,int,int sweeper;vectorint sweeper_size(2);// sweeper size inputcinsweeper_size[0]sweeper_size[1];if(sweeper_size[0]0 sweeper_size[1]0){break;}// sweeper content inputfor(int i1; isweeper_size[0]; i){for(int j1; jsweeper_size[1]; j){cininput;locsmake_pair(i,j);if(input *){sweeper.insert(pairpairint,int,int(locs,1));}else{sweeper.insert(pairpairint,int,int(locs,0));}}}// // debug input// for(auto itsweeper.begin(); it!sweeper.end(); it){// // coutit-first.first,it-first.second:it-secondendl;// coutit-second;// if(it-first.second 4){// coutendl;// }// } // mineSweepercoutField #num:endl;mineSweeper(sweeper, sweeper_size);coutendl;}return 0; }
http://www.dnsts.com.cn/news/263539.html

相关文章:

  • 高端网站建设公司兴田德润可以不搜索引擎营销的优势和劣势
  • 做网站可行性分析房子装修设计软件
  • ps网站背景图片怎么做大连建设学院网站
  • 网站制作完成之后我们便进入了什么阶段设计类专业有哪些
  • 义乌企业网站个人开发网站
  • 网站推广的方法有哪些?wordpress关联博客
  • 搭建本地网站wordpress的网站无法发布文章
  • 精通网站建设网站怎么做移动的窗口
  • 三明企业网站建设公司承德北京网站建设
  • 网赌网站做流量渗透旅游类网站模板免费下载
  • 手机端网站如何优化百度一下你就知道搜索
  • 邯郸市网站建设多少钱手机代理
  • 便捷网站建设价格试用体验网站
  • 网站网页的书签怎么做巴中住房和城乡建设局网站
  • 济南建网站麦积区建设局网站
  • 购物网站建设案例网页图片显示不出来
  • 网站发展历程wordpress国人编辑器
  • 自己做网站要会什么软件wordpress 标签下的文章
  • 东莞网站建设+旅游9uu最新域址永久
  • 龙岗网站建设szaowwordpress 自定义注册
  • 佛山用户网站建站设计师推荐
  • 有哪些商业网站荣成网站建设
  • 网站快速排名优化承德市人才信息网
  • 营销微网站建设公司lamp网站架构
  • 自己建网站能赚钱吗免费网站设计定制
  • 网站入门高碑店做网站的公司
  • 杭州网站优化企业做汽车团购网站有哪些
  • 淘宝上的网站建设可信苏州行业网站建设
  • 新手怎么做跨境电商西安seo引擎搜索优化
  • 网站备案完成后企业服务公司经营范围