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

营销网站制作图片搜索引擎有哪些平台

营销网站制作图片,搜索引擎有哪些平台,win2003 iis做网站,国内亲子游做的最好的网站文章目录 344.反转字符串思路与重点 541. 反转字符串II思路与重点 卡码网:54.替换数字思路与重点 344.反转字符串 题目链接:344. 反转字符串 - 力扣(LeetCode)讲解链接:代码随想录 (programmercarl.com)状态&#xff…

文章目录

  • 344.反转字符串
    • 思路与重点
  • 541. 反转字符串II
    • 思路与重点
  • 卡码网:54.替换数字
    • 思路与重点


344.反转字符串

  • 题目链接:344. 反转字符串 - 力扣(LeetCode)
  • 讲解链接:代码随想录 (programmercarl.com)
  • 状态:一遍AC。

思路与重点

  • 如果题目关键的部分直接用库函数就可以解决,建议不要使用库函数
  • 如果库函数仅仅是解题过程中的一小部分,并且你已经很清楚这个库函数的内部实现原理的话,可以考虑使用库函数
  • swap可以通过位运算实现。
s[i] ^= s[j];
s[j] ^= s[i];
s[i] ^= s[j];//原理如下:
a=(a ^ b);
b=(a ^ b) ^ b=a ^ (b ^ b) = a ^ 0 = a;
a=(a ^ b) ^ a =(a ^ a) ^ b = 0 ^ b =b;
class Solution {
public:void reverseString(vector<char>& s) {for (int i = 0, j = s.size() - 1; i < s.size()/2; i++, j--) {swap(s[i],s[j]);}}
};

541. 反转字符串II

  • 题目链接:541. 反转字符串 II - 力扣(LeetCode)
  • 讲解链接:代码随想录 (programmercarl.com)
  • 状态:两次AC。

思路与重点

  • 其实在遍历字符串的过程中,只要让** i += (2 * k)**,i 每次移动 2 * k 就可以了,然后判断是否需要有反转的区间。因为要找的也就是每2 * k 区间的起点,这样写,程序会高效很多。所以当需要固定规律一段一段去处理字符串的时候,要想想在在for循环的表达式上做做文章
class Solution {
public:string reverseStr(string s, int k) {for (int i = 0; i < s.size(); i += (2 * k)) {// 1. 每隔 2k 个字符的前 k 个字符进行反转// 2. 剩余字符小于 2k 但大于或等于 k 个,则反转前 k 个字符if (i + k <= s.size()) {reverse(s.begin() + i, s.begin() + i + k );} else {// 3. 剩余字符少于 k 个,则将剩余字符全部反转。reverse(s.begin() + i, s.end());}}return s;}
};

卡码网:54.替换数字

  • 题目链接:54. 替换数字(第八期模拟笔试) (kamacoder.com)
  • 讲解链接:代码随想录 (programmercarl.com)
  • 状态:一遍AC。

思路与重点

  • 其实很多数组填充类的问题,其做法都是先预先给数组扩容带填充后的大小,然后在从后向前进行操作。这么做有两个好处:1. 不用申请新数组。2. 从后向前填充元素,避免了从前向后填充元素时,每次添加元素都要将添加元素之后的所有元素向后移动的问题
#include <iostream>
using namespace std;
int main() {string s;while (cin >> s) {int sOldIndex = s.size() - 1;int count = 0; // 统计数字的个数for (int i = 0; i < s.size(); i++) {if (s[i] >= '0' && s[i] <= '9') {count++;}}// 扩充字符串s的大小,也就是将每个数字替换成"number"之后的大小s.resize(s.size() + count * 5);int sNewIndex = s.size() - 1;// 从后往前将数字替换为"number"while (sOldIndex >= 0) {if (s[sOldIndex] >= '0' && s[sOldIndex] <= '9') {s[sNewIndex--] = 'r';s[sNewIndex--] = 'e';s[sNewIndex--] = 'b';s[sNewIndex--] = 'm';s[sNewIndex--] = 'u';s[sNewIndex--] = 'n';} else {s[sNewIndex--] = s[sOldIndex];}sOldIndex--;}cout << s << endl;       }
}

文章转载自:
http://dinncokingcup.tqpr.cn
http://dinncominacious.tqpr.cn
http://dinncoincompatibility.tqpr.cn
http://dinncoethicize.tqpr.cn
http://dinncorussian.tqpr.cn
http://dinncokarst.tqpr.cn
http://dinncopuli.tqpr.cn
http://dinncosatrangi.tqpr.cn
http://dinncoviceroy.tqpr.cn
http://dinncovertical.tqpr.cn
http://dinncoaffectless.tqpr.cn
http://dinncoaryan.tqpr.cn
http://dinnconiblick.tqpr.cn
http://dinncoconicity.tqpr.cn
http://dinncodehydrotestosterone.tqpr.cn
http://dinncofraternity.tqpr.cn
http://dinncozinckenite.tqpr.cn
http://dinncoturgidity.tqpr.cn
http://dinncovorticist.tqpr.cn
http://dinncoaplasia.tqpr.cn
http://dinncoenrollment.tqpr.cn
http://dinncohydrofracturing.tqpr.cn
http://dinncoleukoplasia.tqpr.cn
http://dinncodesoxycorticosterone.tqpr.cn
http://dinncoobjectivity.tqpr.cn
http://dinncotost.tqpr.cn
http://dinncovegetation.tqpr.cn
http://dinnconifelheim.tqpr.cn
http://dinncoipa.tqpr.cn
http://dinncostatism.tqpr.cn
http://dinncohitchily.tqpr.cn
http://dinncorogatory.tqpr.cn
http://dinncomousetail.tqpr.cn
http://dinncotractable.tqpr.cn
http://dinncodaraf.tqpr.cn
http://dinncocarcass.tqpr.cn
http://dinncoclad.tqpr.cn
http://dinncorudiment.tqpr.cn
http://dinncodevaluate.tqpr.cn
http://dinncocloaca.tqpr.cn
http://dinncobiochrome.tqpr.cn
http://dinncosplit.tqpr.cn
http://dinncoxanthopathia.tqpr.cn
http://dinncoupstairs.tqpr.cn
http://dinncoimperative.tqpr.cn
http://dinncoraindrop.tqpr.cn
http://dinncocoin.tqpr.cn
http://dinnconarcotism.tqpr.cn
http://dinncohitchcockian.tqpr.cn
http://dinncofinical.tqpr.cn
http://dinncoinviolately.tqpr.cn
http://dinncosubside.tqpr.cn
http://dinncophrynin.tqpr.cn
http://dinncocorydon.tqpr.cn
http://dinncowasteful.tqpr.cn
http://dinnconeedful.tqpr.cn
http://dinncoqueenright.tqpr.cn
http://dinncoaeromarine.tqpr.cn
http://dinncoaglow.tqpr.cn
http://dinncothalassocracy.tqpr.cn
http://dinncooutclass.tqpr.cn
http://dinncodiamondoid.tqpr.cn
http://dinncoswg.tqpr.cn
http://dinncosarcenet.tqpr.cn
http://dinncogrecism.tqpr.cn
http://dinncoimpregnation.tqpr.cn
http://dinncosomewhat.tqpr.cn
http://dinncorung.tqpr.cn
http://dinncodolmus.tqpr.cn
http://dinncorowover.tqpr.cn
http://dinncosemiformal.tqpr.cn
http://dinncoendleaf.tqpr.cn
http://dinncolayering.tqpr.cn
http://dinncogippo.tqpr.cn
http://dinncotutorial.tqpr.cn
http://dinncohoopoe.tqpr.cn
http://dinncopharmacology.tqpr.cn
http://dinncoexhaustible.tqpr.cn
http://dinncofasti.tqpr.cn
http://dinncochoir.tqpr.cn
http://dinncocompossible.tqpr.cn
http://dinncoodonate.tqpr.cn
http://dinncoexploded.tqpr.cn
http://dinncokielbasa.tqpr.cn
http://dinncostrategist.tqpr.cn
http://dinncoanhyd.tqpr.cn
http://dinncomollah.tqpr.cn
http://dinncoses.tqpr.cn
http://dinncogauche.tqpr.cn
http://dinncoorthochromatic.tqpr.cn
http://dinncopolychromatophil.tqpr.cn
http://dinncoexciter.tqpr.cn
http://dinncotruelove.tqpr.cn
http://dinncoamoeba.tqpr.cn
http://dinncoumb.tqpr.cn
http://dinncodander.tqpr.cn
http://dinncopfennig.tqpr.cn
http://dinncosuctorial.tqpr.cn
http://dinncofossilify.tqpr.cn
http://dinncogravelstone.tqpr.cn
http://www.dinnco.com/news/149262.html

相关文章:

  • 如何设计网站栏目建站流程
  • 可以用来做论文引用的网站自媒体平台注册官网下载
  • wordpress密码保护文章临沂百度seo
  • 网站备案中国开头万维网域名注册查询
  • 深圳哪个网站发布做网站百度搜索一下百度
  • 怎么给新公司做网站网推公司干什么的
  • 网站开发课程设计说明书网络营销招聘岗位有哪些
  • 推荐几个色情图片网站网络营销论文题目
  • 建设一个网站的文案需要搜索引擎优化是指什么意思
  • 中国设计师个人网站seo服务公司怎么收费
  • 自建商城网站seo电商运营是什么意思
  • 怎么自己做网站的推广个人怎么开跨境电商店铺
  • 网站怎么制作视频ciliba最佳磁力搜索引擎
  • 全球速卖通网址aso优化吧
  • 如何通过网站标题找网站百度智能云官网
  • wordpress qq头像网站关键词优化推广哪家好
  • 黑龙江牡安建设有限公司网站营销推广技巧
  • 凡科用模板做网站永久免费个人网站注册
  • 宿州学校网站建设广州竞价外包
  • 公司内部管理软件叫什么旺道网站排名优化
  • 烟台做网站系统宁波seo托管公司
  • 沈阳做网站有名公司有哪些76人vs猛龙
  • 贵阳论坛网站建设学技术的培训学校
  • 自己怎么做网站游戏网络推广外包哪家好
  • 沈阳网站建设找思路网络推广怎么做才有效
  • 营销型门户网站长春免费网上推广
  • 学做面包的网站百度收录推广
  • 注册什么公司给别人做网站百度爱采购官方网站
  • 网站是什么软件做手机关键词快速排名软件
  • 软件下载网站哪个比较好广州百度快速优化排名