电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

2024华为笔试题VIP免费

2024华为笔试题_第1页
1/23
2024华为笔试题_第2页
2/23
2024华为笔试题_第3页
3/23
2022华为笔试题华为2022笔试题华为认证覆盖路由交换、无线局域网、无线、传送网、平安、统一通信、视讯、云计算、服务器、存储以及ICT融合设计等11个技术领域。下面是我整理的关于华为2022笔试题,希望大家仔细阅读!1.删除字符串中的指定字符1.1问题描述第1页共23页输入两个字符串M和N,从字符串M中删除字符串N中全部的字符。例如,输入;abcda;和;ac;,则删除之后的'第一个字符串变成;bd;。1.2问题求解这个比较简洁,给出如下参考代码:#includeusingnamespacestd;voiddeleteCharacter(string&str0,string&str1){for(inti=0;iname="";this->math=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.lang>right.math+right.lang;//降序排列}intmain(){vectorstudentVec;stringinput;Studentstudent;第11页共23页vectorsplitedRes;while(getline(cin,input)){ints=input.find("NAME=");inte=input.find(',',s);if(input.find("LODGRADE")!=string::npos){//输入成果student.name=input.substr(s+5,e-s-5);s=input.find("MATH=");e=input.find(',',s);第12页共23页if(e==string::npos)e=input.length()-1;student.math=stoi(input.substr(s+5,e-s-5));s=input.find("LANG=");e=input.find(',',s);if(e==string::npos)e=input.length()-1;student.lang=stoi(input.substr(s+5,e-s-5));studentVec.push_back(student);}else{//查询成果e=input.length()-1;第13页共23页stringname=input.substr(s+5,e-s-5);Studentstudent;//数学排名std::sort(studentVec.begin(),studentVec.end(),compareMath);vector::iteratorit=find(studentVec.begin(),studentVec.end(),Student(name,0,0));student=*it;第14页共23页while(it!=studentVec.begin()&&(it-1)->math==it->math)--it;intmathRank=it-studentVec.begin()+1;//语文排名std::sort(studentVec.begin(),studentVec.end(),compareLang);it=find(studentVec....

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

2024华为笔试题

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部