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

wordpress sliderwp系统网站如何做seo

wordpress slider,wp系统网站如何做seo,临沭县建设局官方网站,高校文明建设网站CSTL之Map容器 - 数据结构教程 - C语言网 (dotcpp.com)https://www.dotcpp.com/course/118CSTL之Pair类模板 - 数据结构教程 - C语言网 (dotcpp.com)https://www.dotcpp.com/course/119 刷到一个扫雷的题目,之前没有玩怎么过扫雷,于是我就去玩了玩…

C++STL之Map容器 - 数据结构教程 - C语言网 (dotcpp.com)icon-default.png?t=N7T8https://www.dotcpp.com/course/118C++STL之Pair类模板 - 数据结构教程 - C语言网 (dotcpp.com)icon-default.png?t=N7T8https://www.dotcpp.com/course/119        刷到一个扫雷的题目,之前没有玩怎么过扫雷,于是我就去玩了玩,一玩就凌晨两点,直接上瘾好几天哈哈。

        言归正传,瞅瞅这道编程题,不难,用pair表示坐标,map<pair<int,int>,int>关联容器存储各坐标点状态(key-2维坐标,value-地雷状态0/1),然后迭代器遍历map地雷阵,计算当前坐标点处四周8个位置的地雷数(注意地雷矩阵边缘处的邻近区域的特殊性,可以通过map的find()成员函数的返回值鉴定),输出。

 

#include<iostream>
#include<map>
#include<vector>
using namespace std;void mineSweeper(const map<pair<int,int>,int>& sweeper, vector<int>& sweeper_size){for(auto it=sweeper.begin(); it!=sweeper.end(); it++){// sweeperif(it->second == 1){cout<<"*";}// not sweeper, count sweeper_num aroundelse{int sweeper_sum=0;for(int i=-1; i<=1; i++){for(int j=-1; j<=1; 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;// cout<<"<"<<sweeper_sum<<">";}}}cout<<sweeper_sum;}if(it->first.second == sweeper_size[1]){cout<<endl;}}
}int main()
{int num = 0;while(1){++num;// inputpair<int,int> locs;char input;map<pair<int,int>,int> sweeper;vector<int> sweeper_size(2);// sweeper size  inputcin>>sweeper_size[0]>>sweeper_size[1];if(sweeper_size[0]==0 && sweeper_size[1]==0){break;}// sweeper content inputfor(int i=1; i<=sweeper_size[0]; i++){for(int j=1; j<=sweeper_size[1]; j++){cin>>input;locs=make_pair(i,j);if(input == '*'){sweeper.insert(pair<pair<int,int>,int>(locs,1));}else{sweeper.insert(pair<pair<int,int>,int>(locs,0));}}}// // debug input// for(auto it=sweeper.begin(); it!=sweeper.end(); it++){//     // cout<<it->first.first<<","<<it->first.second<<":"<<it->second<<endl;//     cout<<it->second;//     if(it->first.second == 4){//         cout<<endl;//     }// }  // mineSweepercout<<"Field #"<<num<<":"<<endl;mineSweeper(sweeper, sweeper_size);cout<<endl;}return 0;
}

http://www.yayakq.cn/news/710761/

相关文章:

  • 网站托管如何收费广告优化师招聘
  • edo网站建设seo技术培训中心
  • 亚马逊做外贸英文网站品牌咨询
  • 重庆璧山网站制作公司电话电商推广
  • 俱乐部网站php源码wordpress精简主题
  • 一个完整的电商网站开发周期做微信网站公司名称
  • 甘肃省第八建设集团公司网站杭州建设网 郎鑫
  • 百度做的网站能优化吗上海人才网官网首页
  • 网站关键字优化地点互联网网站建设制作
  • 沈阳 网站开发制作那些网站可以做行测题
  • 营销型网站建设的选择方式ios手机网站建设
  • 济南做网站 推荐行知科技优秀室内设计平面图
  • 上海网站建设服务是什么意思termux 安装wordpress
  • 水利建设相关网站创建一个行业网站多少钱
  • 谁有马和人做的网站网络营销的工作岗位
  • 漯河网站建设服务公司一天赚30000的偏门
  • 众鱼深圳网站建设去哪学做网站
  • 福建省住房和建设厅网站google安卓手机下载
  • 的网站建筑培训网查询
  • opencart做的网站用lamp搭wordpress
  • 开发技术网站开发技术路线四川建设厅网站登录不上咋办
  • 张掖市作风建设年活动网站温州瓯海区营销型网站建设
  • 织梦软件网站模板下载如何用模版做网站
  • 帝国cms是个人网站开发公司企业管理制度
  • 邯郸公司网站建设推广平台哪儿有怎么做
  • 响应式网站模板 开源汕尾网站设计
  • 知识产权教育平台网站开发总结python和c++学哪个好
  • 郑州网站建设更好wordpress对接COS后网站变慢
  • 广州购物网站wordpress 删除底部
  • 网站动画用什么做网站建设程序结构