欢迎来到天天文库
浏览记录
ID:57097507
大小:46.50 KB
页数:17页
时间:2020-08-02
《嵌入式工程师面试题--经典资料.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、嵌入式工程师面试题--经典精品文档1、将一个字符串逆序2、将一个链表逆序3、计算一个字节里(byte)里面有多少bit被置14、搜索给定的字节(byte)5、在一个字符串中找到可能的最长的子字符串6、字符串转换为整数7、整数转换为字符串style="MARGIN:0px;COLOR:rgb(102,102,102);LINE-HEIGHT:150%"wrap="break-word"1、char*strconv(char*p){inti,length;chartemp;length=strlen(p);for(i=0;i2、){temp=*(p+i);*(p+i)=*(p+length-1-i);*(p+length-1-i)=temp;}returnp;}intmain()收集于网络,如有侵权请联系管理员删除精品文档{charsrc[100];char*p;scanf("%s",src);p=strconv(src);printf("%s",p);return0;}style="MARGIN:0px;COLOR:rgb(102,102,102);LINE-HEIGHT:150%"wrap="break-word"3、intcal(intdata)//calcu3、lationthenumberofbitinonebyte{inta;intcount=0;a=data%100;while(a!=0){count+=a%2;a/=2;}returncount;}intmain()收集于网络,如有侵权请联系管理员删除精品文档{intd,count;scanf("%d",&d);count=cal(d);printf("%dofone",count);return0;}style="MARGIN:0px;COLOR:rgb(102,102,102);LINE-HEIGHT:150%"wrap="break-w4、ord"4、#include#includevoidfindmax(char*p){intj=0,max=0;intcount=0;charrecord[200];charrecordmax[200];for(inti=0;;i++){if((*(p+i)=='')5、6、(*(p+i)==' ')){if(count>max)收集于网络,如有侵权请联系管理员删除精品文档{max=count;record[j]=' ';strcpy(recordmax,record);}count=0;j=0;}else{r7、ecord[j]=*(p+i);count++;j++;}if(*(p+i)==' ')break;}printf("%s",recordmax);}intmain()收集于网络,如有侵权请联系管理员删除精品文档{charstr[]="zengweidsfdsaflangdhah";printf("%s",str);findmax(str);return0;}style="MARGIN:0px;COLOR:rgb(102,102,102);LINE-HEIGHT:150%"wrap="break-word"#include8、h>#include#includetypedefstructshopping{chargoods[100];structshopping*next;}SHOP;SHOP*buildlink()//创建链表{chargoods[100];SHOP*head,*p,*h;p=(SHOP*)malloc(sizeof(SHOP));head=p;收集于网络,如有侵权请联系管理员删除精品文档head->next=NULL;printf("Inputthreegoods:");for(inti=0;i<3;i++)9、{scanf("%s",goods);p=(SHOP*)malloc(sizeof(SHOP));strcpy(p->goods,goods);p->next=NULL;if(head->next==NULL){head->next=p;h=p;}else{h->next=p;h=h->next;}}returnhead;}voidshowlink(SHOP*head)//显示链表收集于网络,如有侵权请联系管理员删除精品文档{SHOP*p;p=head->next;while(p!=NULL){printf("%s",p->goods);p=p-10、>next;}printf("");}SHOP*revlink(SHOP*head)//反转链表{SHOP*p,*newp;p=he
2、){temp=*(p+i);*(p+i)=*(p+length-1-i);*(p+length-1-i)=temp;}returnp;}intmain()收集于网络,如有侵权请联系管理员删除精品文档{charsrc[100];char*p;scanf("%s",src);p=strconv(src);printf("%s",p);return0;}style="MARGIN:0px;COLOR:rgb(102,102,102);LINE-HEIGHT:150%"wrap="break-word"3、intcal(intdata)//calcu
3、lationthenumberofbitinonebyte{inta;intcount=0;a=data%100;while(a!=0){count+=a%2;a/=2;}returncount;}intmain()收集于网络,如有侵权请联系管理员删除精品文档{intd,count;scanf("%d",&d);count=cal(d);printf("%dofone",count);return0;}style="MARGIN:0px;COLOR:rgb(102,102,102);LINE-HEIGHT:150%"wrap="break-w
4、ord"4、#include#includevoidfindmax(char*p){intj=0,max=0;intcount=0;charrecord[200];charrecordmax[200];for(inti=0;;i++){if((*(p+i)=='')
5、
6、(*(p+i)==' ')){if(count>max)收集于网络,如有侵权请联系管理员删除精品文档{max=count;record[j]=' ';strcpy(recordmax,record);}count=0;j=0;}else{r
7、ecord[j]=*(p+i);count++;j++;}if(*(p+i)==' ')break;}printf("%s",recordmax);}intmain()收集于网络,如有侵权请联系管理员删除精品文档{charstr[]="zengweidsfdsaflangdhah";printf("%s",str);findmax(str);return0;}style="MARGIN:0px;COLOR:rgb(102,102,102);LINE-HEIGHT:150%"wrap="break-word"#include8、h>#include#includetypedefstructshopping{chargoods[100];structshopping*next;}SHOP;SHOP*buildlink()//创建链表{chargoods[100];SHOP*head,*p,*h;p=(SHOP*)malloc(sizeof(SHOP));head=p;收集于网络,如有侵权请联系管理员删除精品文档head->next=NULL;printf("Inputthreegoods:");for(inti=0;i<3;i++)9、{scanf("%s",goods);p=(SHOP*)malloc(sizeof(SHOP));strcpy(p->goods,goods);p->next=NULL;if(head->next==NULL){head->next=p;h=p;}else{h->next=p;h=h->next;}}returnhead;}voidshowlink(SHOP*head)//显示链表收集于网络,如有侵权请联系管理员删除精品文档{SHOP*p;p=head->next;while(p!=NULL){printf("%s",p->goods);p=p-10、>next;}printf("");}SHOP*revlink(SHOP*head)//反转链表{SHOP*p,*newp;p=he
8、h>#include#includetypedefstructshopping{chargoods[100];structshopping*next;}SHOP;SHOP*buildlink()//创建链表{chargoods[100];SHOP*head,*p,*h;p=(SHOP*)malloc(sizeof(SHOP));head=p;收集于网络,如有侵权请联系管理员删除精品文档head->next=NULL;printf("Inputthreegoods:");for(inti=0;i<3;i++)
9、{scanf("%s",goods);p=(SHOP*)malloc(sizeof(SHOP));strcpy(p->goods,goods);p->next=NULL;if(head->next==NULL){head->next=p;h=p;}else{h->next=p;h=h->next;}}returnhead;}voidshowlink(SHOP*head)//显示链表收集于网络,如有侵权请联系管理员删除精品文档{SHOP*p;p=head->next;while(p!=NULL){printf("%s",p->goods);p=p-
10、>next;}printf("");}SHOP*revlink(SHOP*head)//反转链表{SHOP*p,*newp;p=he
此文档下载收益归作者所有