




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
本文格式为Word版,下载可任意编辑——华为上机笔试
//报数问题.cpp:定义控制台应用程序的入口点。//
#include\#includeusingnamespacestd;
structCYCLE{intnum;structCYCLE*next;};
voidcircle_sort(intn,ints,intm,int*p){structCYCLE*people=(CYCLE*)malloc(sizeof(CYCLE));structCYCLE*head=people;//头部people->num=1;//intj=1;intt=m;inta=0;//记录输出个数//初始化;for(intj=2;jnum=j;people->next=temp;people=people->next;}people->next=head;//循环链表head=people->next;while(people->num!=s){people=people->next;}
while(a1){people=people->next;}//deletestructCYCLE*ttt=people->next;p[a]=ttt->num;a++;people->next=ttt->next;delete(ttt);people=people->next;t=m;}}
intmain(intargc,char*argv[]){inta[7]={0};int*p=a;intn=3;ints=1;intm=2;circle_sort(n,s,m,p);for(inti=0;is;return0;}
//字串查找.cpp#include\#include
intstrlen(char*p){}
unsignedintstr_str(char*src,char*dst){
intlen_src=0;intlen_dst=0;intj=0;inti=0;
len_src=strlen(src);len_dst=strlen(dst);
if(len_src
voidcount(constchar*input,unsignedint*letters,unsignedint*numbers,unsignedint*blanks,unsignedint*others){
inti=0;
}
while(input[i]!='\\0'){}
if(input[i]>=65elseif(input[i]>=97elseif(input[i]>=48elseif(input[i]==32)(*blanks)++;else(*others)++;i++;
voidmain(){}
constchar*input=\;unsignedinti=0;unsignedintj=0;unsignedintm=0;unsignedintn=0;unsignedint*letters=unsignedint*numbers=unsignedint*blanks=unsignedint*others=
count(input,letters,numbers,blanks,others);
printf(\,*letters,*numbers,*blanks,scanf(\,*numbers);
*others);
//数制转换.cpp:定义控制台应用程序的入口点。
#include
voidDecToBin(unsignedintiDec,charpBin[32]){
}
unsignedinti;pBin[32]='\\0';i=31;while(iDec){}
pBin[i]=iDec%2+'0';iDec=iDec/2;i--;
voidmain(){}
unsignedintdec=8;charpBin[32];
for(inti=0;i
intisWorking(unsignedintyear,unsignedintmonth,unsignedintday){
if(year12||month31){printf(\);return
-1;}/*}
voidmain(){
unsignedintyear,month,day;
intsumDays=sum_year_Days+sum_month_Days+day;intresult=sumDays%5;
if(result>=1elsereturn0;switch(month){}
if((year@0==0||(year%4==0*/
intmonth_day[]={31,28,31,30,31,30,31,31,30,31,30,31};if(year@0==0||(year%4==0for(inti=0;i#includeusingnamespacestd;
#defineSIZE10typedefcharelem1;typedefintelem2;
elem1optr[SIZE];elem2opnum[SIZE];inttop1,top2;
voidInitstack(elem1e1){}
voidInitstack(elem2e2){}
voidpush(elem1*e1,elem1x){}
voidpush(elem2*e2,elem2x){}
voidpop(elem1*e1,elem1charc;
while(*exp!='\\0'){
if(*exp>='0'push(opnum,t);}else
switch(*exp){
case'+':push(optr,*exp);break;
x=*e-'0';x=e2[top2-1];x=e1[top1-1];x=e2[--top2];x=e1[--top1];e2[top2++]=x;e1[top1++]=x;top2=0;top1=0;
}
}
}
case'-':push(optr,*exp);break;
case'*':pop(opnum,temp);getnum(++exp,t);push(opnum,temp*t);break;case'/':pop(opnum,temp);getnum(++exp,t);push(opnum,temp/t);break;
exp++;
while(top1!=0){}
pop(opnum,temp);returntemp;
pop(optr,c);switch(c){}
case'+':pop(opnum,temp);pop(opnum,t);push(opnum,temp+t);break;case'-':pop(opnum,temp);pop(opnum,t);push(opnum,t-temp);break;
intmain(){}
char*c=\;intlen=9;
intt=calculate(len,c);cout>t;return0;
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 店面装修方案流程范本
- 2025-2030中国花草茶行业市场深度调研及发展趋势与投资前景预测研究报告
- 2025-2030中国节能暖风机行业市场深度调研及竞争格局与投资研究报告
- 2025-2030中国色氨酸行业市场现状供需分析及投资评估规划分析研究报告
- 2025-2030中国航拍行业发展前景及发展策略与投资风险研究报告
- 2025-2030中国自行车鞋行业市场现状供需分析及投资评估规划分析研究报告
- 铝塑板圆弧门头施工方案
- 2025-2030中国脱脂鱼粉行业市场发展趋势与前景展望战略研究报告
- 2025-2030中国脂肪醇醚硫酸盐(AES)市场未来发展预测及投资前景分析报
- 2025-2030中国胎儿和新生儿监护仪行业市场发展趋势与前景展望战略分析研究报告
- (一统)昆明市2025届高三“三诊一模”摸底诊断测试 政治试卷(含官方答案)
- 2025年上海市浦东新区高三语文一模作文题目解析及范文:一个人履行责任是否意味着放弃自由
- 广东省2024年中考数学试卷(含答案)
- JBT 11699-2013 高处作业吊篮安装、拆卸、使用技术规程
- 2024年全国版图知识竞赛(小学组)考试题库大全(含答案)
- 肌肉注射并发症预防与处理
- 《淹溺急救》PPT课件(2022版)
- 水表施工组织方案.doc
- 招标代理机构内部管理制度51401
- 过程控制系统与仪表习题答案王再英
- 北京爱琴海购物中心工程部管理制度手册
评论
0/150
提交评论