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

电商品牌网站开发运营怎么建立自己的网站

电商品牌网站开发运营,怎么建立自己的网站,网站开发执行什么标准号,自己建网站做appCSTL之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.ho-use.cn/article/1749.html

相关文章:

  • 网站策划报告怎么写seo外链工具源码
  • 网站建设插件搜索引擎排名2022
  • 日本做设计的网站有哪些方面百度关键词怎么设置
  • 佛山市建网站做网站费用百度号码认证平台取消标记
  • 国外做外挂的网站百度升级最新版本
  • 毛片a做片在线观看网站有哪些西安快速排名优化
  • 建筑网站大全免费百度手机助手免费下载
  • 成都科技网站建设找哪家上海网络seo公司
  • 美甲网站模板品牌企业seo咨询
  • 如何进行主题网站的资源建设佛山网站建设模板
  • 平台类网站成都seo排名
  • 建设网站遇到的问题网络营销策划ppt
  • 道真县城乡建设局网站google登录入口
  • 九江网站建设网络营销的核心是什么
  • 网站 宗旨泰安百度公司代理商
  • 常德做网站公司哪家好seo排名赚app最新版本
  • 怎么建一个公司运营网站十大经典案例
  • 产品设计包括哪些方面厦门seo招聘
  • 二季域名做网站怎么推广淘宝店铺
  • 移动论坛网站模板百度seoo优化软件
  • 打折网站运营思路免费cms建站系统
  • 怎么问客户做不做网站网络营销的常用工具
  • 做logo设计网站凌云seo博客
  • 网站设计怎么做视频肇庆网站搜索排名
  • 如何评估一个网站seo的优异程度北京网站建设运营
  • 深圳网站建设深圳网seo技术分享
  • 免费网站建设哪家好企业网站推广效果指标分析
  • discuz 修改网站标题百度问答兼职怎么做
  • 怎么创办一个网站百度竞价一个月5000够吗
  • 网站制作三级页面排超联赛积分榜