2022华为笔试题华为2022笔试题华为认证覆盖路由交换、无线局域网、无线、传送网、平安、统一通信、视讯、云计算、服务器、存储以及ICT融合设计等11个技术领域
下面是我整理的关于华为2022笔试题,希望大家仔细阅读
删除字符串中的指定字符1
1问题描述第1页共23页输入两个字符串M和N,从字符串M中删除字符串N中全部的字符
例如,输入;abcda;和;ac;,则删除之后的'第一个字符串变成;bd;
2问题求解这个比较简洁,给出如下参考代码:#includeusingnamespacestd;voiddeleteCharacter(string&str0,string&str1){for(inti=0;imath=0;this->lang=0;}Student(stringname,intmath,intlang){this->name=name;第8页共23页this->math=math;this->lang=lang;}booloperator==(constStudent&ele){returnthis->name==ele
name;}};//自定义比较函数,数学排名boolcompareMath(constStudent&left,const第9页共23页Student&right){returnleft
math>right
math;//降序排列}//自定义比较函数,语文排名boolcompareLang(constStudent&left,constStudent&right){returnleft
lang>right
lang;//降序排列}//自定义比较函数,总分排名第10页共23页boolcompareTotal(constStudent&left,constStudent&right){returnleft
math+left