ImageVerifierCode 换一换
格式:DOCX , 页数:43 ,大小:26.09KB ,
资源ID:8403045      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-8403045.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(硕士研究生计算机复试上机试题Word文件下载.docx)为本站会员(b****6)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

硕士研究生计算机复试上机试题Word文件下载.docx

1、9) ai=xi-; else if(xiAZ+10;az unsigned aIndex1=0,aIndex2=0,bIndex=0; int iyu=0; while(aIndex1xLen) iyu=0; aIndex2=aIndex1; while(aIndex2=0&iyu=9) bbIndex=iyu+ else bbIndex=iyu-10+ bIndex+; bbIndex=0 strrev(b); printf(%sn,b); return 0;输入一个数组的值,求出各个值从小到大排序后的次序。输入:输入的第一个数为数组的长度,后面的数为数组中的值,以空格分割输出:各输入的值

2、按从小到大排列的次序。sampleinput:4-3 75 12 -3output:1 3 2 1int exist(int arr,int len,int elem) for(int i=0;len; if(arri=elem) return i; arrlen=elem; return -1; int inputNum,i,j,plen,temp; int nums1000,num11000; while(scanf(%dinputNum)!=EOF) for(i=0,plen=0;inputNum; scanf(numsi); if(exist(num1,plen,numsi)=-1)

3、plen+; for(i=1;plen; for(j=0;jnum1j+1) temp=num1j; num1j=num1j+1; num1j+1=temp; for(i=0; if(i!=0) printf( ); printf(,exist(num1,plen,numsi)+1); printf(n/*给定两个整数A和B,其表示形式是:从个位开始,每三位数用逗号,隔开。现在请计算A+B的结果,并以正常形式输出。*/iostreamstringusing namespace std;int covert(string input) int l=input.length(); long lon

4、g sum=0; char temp= for (int i=0;l; temp=inputi; if(temptempinputAinputB) A=covert(inputA); B=covert(inputB); coutA+Blength-1-lastJidx)return false; if(front=rear&middle=o return true; else string newStr=input.erase(length-front.length(); newStr=newStr.erase(firstZIdx+1,1); return judge(newStr);inpu

5、tA) if(judge(inputA) coutAcceptedn else cout/统计文件中的单词数目int _tmain(int argc, _TCHAR* argv) /read ifstream ifs(zxh.txt,ios:in); char c;int wordNum=0;bool isSpace=true; while(!ifs.eof() c=ifs.get(); if(c= |c=nrt if(!isSpace)/上一个不是空白字符 这一个是 isSpace=true; wordNum+; if(isSpace)/上一个是空白字符 这一个不是 isSpace=fals

6、e; if(c!c!=-1) wordNum+; ifs.close(); couta;1输入一个数列以0位结束标志,建立链式线性表,查找其中最大的数并输出删除释放节点,然后对剩余的进行排序,并输出释放节点struct node int data; node* next;void printList(node*head)/print node * p=head-next; while(p!=NULL)p-dataendl; node* head=new node(); head-next=NULL; node* n,*p=head; int length=0;c)/create) break;

7、 if(c coutdata=c-48; p-next=n; length+; printList(head); /find max int max=0; n=p=head;/parent while(p-next! if(p-next-datamax) max=p-data; n=p;/n point to the maxs parentThe max num is :max n-next=n- free(p); length-; /sort p=head; for(int i=length;i0;i-) p=head; for(int j=0;i-1; if(p-data) n=p- p-

8、 n- p=p- /print and free while(head-head- p=head- free(head); head=p; free(head); int m; cinm;/输入一个数列以0位结束标志,建立二叉遍历数,并对其进行逆中序遍历,释放空间/需要注意的是 释放空间时候 只用在每次递归释放root就ok 不要重复释放root-lchild 和 root-rchildstruct treeNode char data; treeNode* lchild,*rchild;treeNode* createTree()c; if(c=) return NULL; treeNode

9、 * root=new treeNode(); root-data=c;lchild=createTree();rchild=createTree(); return root;void opposingMidTraverse(treeNode*root) if(root=NULL) return; if(root-rchild!=NULL) opposingMidTraverse(root-rchild);root-lchild!lchild); free(root); treeNode*root=createTree(); opposingMidTraverse(root);/*第三题是

10、输入一个ip地址串,判断是否合法合法ip地址满足: 无非法字符(非数字字符和.).之间的数字在0-255之间 不是C、D类ip,ips0 string ip;bigWhile:ip) int ips4; for(int i=0;ip.length(); if(!isdigit(ipi)&ipi!) coutip地址只能是数字或者.组成,您输入了非法字符吧n goto bigWhile; char* c_ip=(char*)ip.c_str(),*strptr; strptr=strtok(c_ip,. char*ips_str=(char*)malloc(sizeof(char*)*10);i

11、nt i=0; while(strptr! ips_stri=strptr; i+; strptr=strtok(NULL, if(i!=4)请输入合法的ipv4地址,四段哦! goto bigWhile;4; ipsj=atoi(ips_strj); if(ipsj255)ip地址字段只能是0-255的数字! if(ips0=127|ips0=224) ip地址只能是ABC类地址,而且也不能是本地回环地址啊! if(ips0ips0127&=191)/B类 if(ips2=0&ips3=0)|(ips2=255& if(ips0=172&ips1=16&ips1=31)合法ip地址不能是B类

12、专用地址(172.16.0.0-171.31.255.255)n191&=223)/C类 if(ips3=0)|(ips3=255) if(ips0=192&ips1=168)合法ip地址不能是C类专用地址(192.168.0.0-192.168.255.255)nips2ips3是合法ip地址O(_)On第一题:对给定的一个字符串,找出有重复的字符,并给出其位置,如:abcaaAB12ab12输出:a,1;a,4;a,5;a,10 b,2;b,11 1,8;1,12 2,9;2,13 string inputStr; char current; int index=-1,lastIndex,firstIndex;inputStr)inputStr.length(); current=inputStri; firstIndex=inputStr.find_first_of(current); lastIndex=inputStr.find_last_of(current); if(firstIndex!=lastIndex)&

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2