华中科技大学计算机学院上机复试题目.doc

华中科技大学计算机学院上机复试题目.doc

  1. 1、本文档共49页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
华中科技大学计算机学院上机复试题目

上机考试。一般网站上公布上机环境要求是TC2.0,但实际上是可以使用VC的。这里有一点特别要大家注意:TC2.0只支持纯C代码,不支持C++风格代码。学生称,不管你是用VC还是TC,老师都要在TC2.0上进行验收程序,以确认你的代码是纯C。比如:p = new Node ; 的代码写法在TC2.0下是通不过的,只能写p = (Node *)malloc (sizeof (Node)) ; 。另外TC2.0不支持引用,如:Pop (Stack s , ElemType e)中含有“”的引用,在TC2.0下无法通过。 华科的上机题目每年都差不多,经常考的就是排序、链表和树的操作等。建议在去复试前专门练习上机。08年的华科招收上机试题: (1)输入一个十进制数,将其先转化为八进制数,然后再输出#include stdio.h main() { int a = 0 ; printf (Please enter a decimal number:) ; scanf (%d,a) ; printf (%ds octal number is %o\n,a,a) ; } (2)用户输入一个文本名,编程实现输出文本中最长的一行和最短的一行。如果最长和最短的不止一行,请全部输出。#include stdio.h #include stdlib.h #include string.h #define BUFFSIZE 1000 int main() { FILE *fp; char filename[255]; printf(input file name:); scanf(%s,filename); if (NULL==(fp=fopen(filename,r))) { printf(file open error!); return 0; } char Line[BUFFSIZE][BUFFSIZE]; int i=0; int cnt=0; while((fgets(Line[i], BUFFSIZE, fp))iBUFFSIZE) { //printf(%s,Line[i]); i++; cnt++; } char tempMax[BUFFSIZE]; char tempMin[BUFFSIZE]; strcpy(tempMax,Line[0]); strcpy(tempMin,Line[0]); //printf(%s\n,tempMax); for(i=1;icnt;i++) { if(strlen(Line[i])strlen(tempMax)) strcpy(tempMax,Line[i]); if(strlen(Line[i])strlen(tempMax)) strcpy(tempMin,Line[i]); } int j=-1; printf(longest string:\n); for(i=0;icnt;i++) { if(strlen(Line[i])==strlen(tempMax)) { printf(%s\n,Line[i]); } } printf(\n\nshortest string:\n); for(i=0;icnt;i++) { if(strlen(Line[i])==strlen(tempMin)) { printf(%s,Line[i]); } } fclose(fp); return 0; } (3)输入学生信息:学号,三门课程的成绩,学号为0时结束,将其存储在链表A中,从中找出分数大于平均分的学生,并将该学生信息按平均分降序排列存入到链表B中,最后输出链表B。#include stdio.h #include stdlib.h #include string.h typedef struct node {char xuehao[20];int chengji[3];float av;struct node *next; }stud,*UerInfo; int main() { UerInfo ui; ui=(UerInfo)malloc(sizeof(stud)); UerInfo p=ui; UerInfo q=ui; UerInfo tempB=ui; printf(input students information:\n); int cnt=0; wh

文档评论(0)

xcs88858 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档