考研 计算机 机试题,华中科技大学计算机考研复试机试题(含代码)

本文介绍了华中科技大学计算机考研复试的机试题型及要求,强调了C++编程规范,如禁止使用引用,要求使用malloc分配内存。复习重点包括排序、链表和树的操作。建议考生在复试前进行大量上机练习,提高编程速度。2010年机试题示例包括奇校验、冒泡排序和约瑟夫环问题等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

《华中科技大学计算机考研复试机试题(含代码)》由会员分享,可在线阅读,更多相关《华中科技大学计算机考研复试机试题(含代码)(12页珍藏版)》请在人人文库网上搜索。

1、支持C+M格代码。华科的计算机学生称,不管你是用VC还是TC,老师都要在上进行验收程序,以确认你的代码是纯C。比如:p=new Node ;的代码写法在下是通不过的,只能写p = (Node *)malloc (sizeof (Node);。另外不支持引用,如:Pop (Stack&s , ElemType &e)中含有“&”的引用,在下无法通过。华科的上机题目每年都差不多,经常考的就是排序、链表和树的操作等。建议在去复试前一定要进行专门练习上机。Note:上机时间为1个半小时,题目一般为三道题,前两道一般代码不会超过70行,最后一道会达到150200行。上机时做题速度一定要快,不要总抓着一个。

2、不放,时间在不知不觉中过的是很快的。2010年的机试题:a、输入一个字符串,然后对每个字符进行奇校验,最后输出校验后的二进制数!(如3,输出:);#include #define max 1000int pd(char c)int i=0;int num=0;for(i=0;i=0;j-)if(ai&(1#includetypedef void (*ptask)();2O11/O3/18 v=tempB-av;sk.chengjiO=tempB-chengjiO;sk.chengji1=tempB-chengji1;sk.chengji2=tempB-chengji2;strcpy(sk.xu。

3、ehao,tempB-xuehao);tempB=tempB-next;k+;int l,m;stud temps;for (l=0;l#include#include void main()int i;int bIsSame = 1;功能:复制 的内容到中#include #define BUFFERSIZE 1000int main(int argc, char *argv)if (argc#includestruct node int data;struct node * link;*list,*p,*r;void JOSEPHUS(int n,int m,int k);int main。

4、()int n,k;printf( 请输入人数 :); scanf(%d,&n);printf(n 请输入从哪里开始 :); scanf(%d,&k);/*printf(n 请输入数到 :); scanf(%d,&m); */if(n!=0)JOSEPHUS(n,3,k); system(PAUSE);return 0;void JOSEPHUS(int n,int m,int k)int i;for (i=1;idata=i;if(list=NULL) list=p;elser-link=p;r=p;p-link=list; p=list;for (i=1;ilink;while(p-lin。

5、k!=p)for(i=1;ilink; r-link=p-link; printf(%dn,p-data); free(p);p=r-link;printf(n 最后被删除结点是 %dn,p-data); (6) 冒泡排序。#define N 10#include =1&change;-i) change=0;for(j=0;jaj+1)temp=aj; aj=aj+1;aj+1=temp; change=1; return 0;int main()int aN;for (int i=0;i#include value=value;t-lchild=createBTree();t-rchild。

6、=createBTree();return t;void InorderBTree(BTree B)if(B)InorderBTree(B-lchild);printf(%dn,B-value);InorderBTree(B-rchild);int main()printf( 输入整数,以结尾 n);BTree B=createBTree();printf( 中序遍历如下 :n);InorderBTree(B);return 0;(8) 生成一个长度为 21 的数组,依次存入 1 到 21;建立一个长度为 21 的单向链表, 将上述数组中的数字依次存入链表每个结点中; 将上述链表变为单向封闭 。

7、(循环)链表;从头结点开始数, 将第17个结点删除, 将它的下一个结点作为新的头结点; 重复上述过程, 直到该链表中只剩一个结点,显示该结点中存入的数字。分三个文件,一个 main; 一个 .h; 一个 .c 文件,写函数( 1) .main#include #include Count int main()struct node * head, * current;int i;head = CreatNode();printf(#%d#n, head - a);while(head - Next != NULL)current = head;for(i = 1; i Next;head = 。

8、current - Next;if(head - Next != current)file#ifndef COUNT_21_H_INCLUDED#define COUNT_21_H_INCLUDED#define NUM 21typedef struct node file#include #include Count struct node * CreatNode()int i;struct node * head = NULL, * current = NULL, * temp = NULL;for(i = 0; i a = 1;temp = head;elsecurrent = (str。

9、uct node * )malloc(sizeof(struct node);temp - Next = current;temp = current;temp - a = i + 1;current - Next = head; /make it a cyclereturn head;void DeleteNode(struct node * current)struct node * temp;temp = current;while(temp - Next != current)temp = temp - Next;(temp - Next) = (current - Next);free(current。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值