欢迎来到天天文库
浏览记录
ID:57256006
大小:111.00 KB
页数:26页
时间:2020-08-07
《华中科技大学计算机学院上机复试题目.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、上机考试。一般网站上公布上机环境要求是TC2.0,但实际上是可以使用VC的。这里有一点特别要大家注意:TC2.0只支持纯C代码,不支持C++风格代码。华科的计算机学生称,不管你是用VC还是TC,老师都要在TC2.0上进行验收程序,以确认你的代码是纯C。比如:p=newNode;的代码写法在TC2.0下是通不过的,只能写p=(Node*)malloc(sizeof(Node));。另外TC2.0不支持引用,如:Pop(Stack&s,ElemType&e)中含有“&”的引用,在TC2.0下无法通过。华科的上机题目每年都差不多,经常考的就是排序、链表和树的操作等。建议在去复试前
2、一定要进行专门练习上机。08年的华科招收研究生上机试题:(1)输入一个十进制数,将其先转化为八进制数,然后再输出#includemain(){inta=0;printf("Pleaseenteradecimalnumber:");scanf("%d",&a);printf("%d'soctalnumberis%o",a,a);}(2)用户输入一个文本名,编程实现输出文本中最长的一行和最短的一行。如果最长和最短的不止一行,请全部输出。#include#include#include#defineB
3、UFFSIZE1000intmain(){FILE*fp;charfilename[255];printf("inputfilename:");scanf("%s",filename);if(NULL==(fp=fopen(filename,"r"))){printf("fileopenerror!");return0;}charLine[BUFFSIZE][BUFFSIZE];inti=0;intcnt=0;while((fgets(Line[i],BUFFSIZE,fp))&&i4、hartempMax[BUFFSIZE];chartempMin[BUFFSIZE];strcpy(tempMax,Line[0]);strcpy(tempMin,Line[0]);//printf("%s",tempMax);for(i=1;istrlen(tempMax))strcpy(tempMax,Line[i]);if(strlen(Line[i])5、or(i=0;i6、输出链表B。#include#include#includetypedefstructnode{charxuehao[20];intchengji[3];floatav;structnode*next;}stud,*UerInfo;intmain(){UerInfoui;ui=(UerInfo)malloc(sizeof(stud));UerInfop=ui;UerInfoq=ui;UerInfotempB=ui;printf("inputstudents'information:");intcnt=0;whil7、e(1){printf("input学号:");scanf("%s",ui->xuehao);if(strcmp(ui->xuehao,"0")==0)break;printf("input成绩:");scanf("%d",&ui->chengji[0]);printf("input成绩:");scanf("%d",&ui->chengji[1]);printf("input成绩:");scanf("%d",&ui->chengji[2]);ui->av=((ui->chengji[0]+ui->chengji[1
4、hartempMax[BUFFSIZE];chartempMin[BUFFSIZE];strcpy(tempMax,Line[0]);strcpy(tempMin,Line[0]);//printf("%s",tempMax);for(i=1;istrlen(tempMax))strcpy(tempMax,Line[i]);if(strlen(Line[i])5、or(i=0;i6、输出链表B。#include#include#includetypedefstructnode{charxuehao[20];intchengji[3];floatav;structnode*next;}stud,*UerInfo;intmain(){UerInfoui;ui=(UerInfo)malloc(sizeof(stud));UerInfop=ui;UerInfoq=ui;UerInfotempB=ui;printf("inputstudents'information:");intcnt=0;whil7、e(1){printf("input学号:");scanf("%s",ui->xuehao);if(strcmp(ui->xuehao,"0")==0)break;printf("input成绩:");scanf("%d",&ui->chengji[0]);printf("input成绩:");scanf("%d",&ui->chengji[1]);printf("input成绩:");scanf("%d",&ui->chengji[2]);ui->av=((ui->chengji[0]+ui->chengji[1
5、or(i=0;i6、输出链表B。#include#include#includetypedefstructnode{charxuehao[20];intchengji[3];floatav;structnode*next;}stud,*UerInfo;intmain(){UerInfoui;ui=(UerInfo)malloc(sizeof(stud));UerInfop=ui;UerInfoq=ui;UerInfotempB=ui;printf("inputstudents'information:");intcnt=0;whil7、e(1){printf("input学号:");scanf("%s",ui->xuehao);if(strcmp(ui->xuehao,"0")==0)break;printf("input成绩:");scanf("%d",&ui->chengji[0]);printf("input成绩:");scanf("%d",&ui->chengji[1]);printf("input成绩:");scanf("%d",&ui->chengji[2]);ui->av=((ui->chengji[0]+ui->chengji[1
6、输出链表B。#include#include#includetypedefstructnode{charxuehao[20];intchengji[3];floatav;structnode*next;}stud,*UerInfo;intmain(){UerInfoui;ui=(UerInfo)malloc(sizeof(stud));UerInfop=ui;UerInfoq=ui;UerInfotempB=ui;printf("inputstudents'information:");intcnt=0;whil
7、e(1){printf("input学号:");scanf("%s",ui->xuehao);if(strcmp(ui->xuehao,"0")==0)break;printf("input成绩:");scanf("%d",&ui->chengji[0]);printf("input成绩:");scanf("%d",&ui->chengji[1]);printf("input成绩:");scanf("%d",&ui->chengji[2]);ui->av=((ui->chengji[0]+ui->chengji[1
此文档下载收益归作者所有