2016年湖南省对口高考真题中,哪一道题的解答过程最复杂?

2026-04-12 04:191阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计1918个文字,预计阅读时间需要8分钟。

2016年湖南省对口高考真题中,哪一道题的解答过程最复杂?

一、选择题型+1、在C语言中,函数值类型在定义时可以省略,省略时函数值的隐含类型是__________。A. voidB. intC. floatD. double

二、用scanf函数输入一个字符到数组str中,以下选项中正确的是__________。A. scanf(%c, &str);B. scanf(%s, str);C. scanf(%d, &str);D. scanf(%f, &str);

一、选择题

1、

在C语言中,函数值类型在定义时可以缺省,缺省时函数值的隐含类型是__________。

A.void B.int C.float D.double

2、

用scanf函数输入一个字符串到数组str中,以下选项中正确的语句是__________。

A.scanf("%s",&str); B.scanf("%c",&str[10]);

C.scanf("%s",str[10]); D.scanf("%s",str);

3、

设有定义语句:int m[ ]={2,4,6,8},*k=m;以下选项中表达式的值为6的是__________。

A.*(k+2) B.k+2 C.*k+2 D.*k+=2

二、程序填空题

以下程序的功能是:从键盘输入班级学生的成绩,计算学生成缋的平均分,并输出高于平均分的学生成绩,输入负数表示输入结束,班级人数不超过100人。

#include "stdio.h" int main() { float x[100],sum=0.0,ave,s; int n=0,i; printf("Enter mark:\n"); scanf("%f",&s); while(s>=0.0 && n<100) { sum= _____ 1 _____ ; x[n]= s; _____ 2 _____ ; scanf("%f",&s); } ave=sum/n; printf("Output:\n"); printf("ave=%f\n",ave); for(i=0; _____ 3 _____ ; i++) if( _____ 4 _____ ) printf("%f\n",x[i]); return 0; }

三、写程序结果

下列程序的运行结果是__________。

#include <stdio.h> void f(char *from,char *to) { while ((*to++=*from++)!='\0'); } int main() { char s1[80]="teacher!"; char s2[80]="student!"; f(s2,s1); printf("s1=%s\n",s1); printf("s2=%s\n",s2); return 0; }

下列程序的运行结果是__________。

#include <stdio.h> void f(int x) { static int y=0; x=0; x++;y++; printf("x=%d,y=%d\n",x,y); } int main() { int i; for(i=0;i<2;i++) f(i); return 0; }

3、

下列程序的运行结果是__________。

#include <stdio.h> int p(int n) { int s=0; while(n) { s=s*10+n%10; n=n/10; } return s; } int main( ) { printf("p=%d\n",p(345)); return 0; }

4、

下列程序的运行结果是__________。

#include <stdio.h> #include <string.h> int main() { int i,x=0,t=1; char s[10]="101010"; for(i=strlen(s)-1; i>=0; i--,t<<=1) if(s[i]!='0') x+=t; printf("x=%d\n",x); return 0; }

5、

下列程序的运行结果是__________。

#include <stdio.h> void f(char *p) { char max, *q; int i=0; max=p[i]; while(p[i]!='\0') { if(max<p[i]) { max=p[i]; q=p+i; } i++; } while(q>p) { *q=*(q-1); q--; } p[0]=max; } int main( ) { char str[80] ="abcde"; f(str); puts(str); printf("\n"); return 0; }

四、程序填空

学生的记录由学号和成绩组成,N名学生的数据己放入主函数中的结构体数组s中。 函数creat()的功能是把结构体数组中的数据写入到二进制文件record.dat中。函数f()的功能是:把指定分数范围内的学生数据放在指针b所指的结构体中,分数范围内的学生人数由函数值返问。例如,输入的分数是60、69,则应当把分数在60~69的学生数据输出,包含60分和69分的学生数据。

#include <stdio.h> #include <string.h> #define N 10 __________ 1 __________ { char num[N]; int score; }SREC; int creat(SREC *std) { FILE * fp; int i; if(( __________ 2 __________ )=NULL) return 0; printf("\n output data to file!\n"); for(i=0;i<N;i++) __________ 3 __________ fclose(fp); return 1; }/*creat()函数结束*/ int f(SREC *a,SREC *b,int l,int h); int main( ) { SREC s[N]={{"001",85},{"002",76},{"003",69},{"004",85},{"005",96}, {"006",72},{"007",56},{"008",87},{"009",91},{"010",45}}; SREC h[N]; /*h用来存放满足分数条件范围内的学生数据*/ int i,n,low,heigh,t; /* n用来存放满足分数条件范围内的学生人数*/ int result; /*low、heigh分别用來存放分数范围的下界与上界*/ result=creat(s); /* result表示文件写入操作是否成功*/ if(result) { printf("\n low="); scanf("%d",&low); printf("\n heigh="); scanf("%d",&heigh); if(heigh<low) { t=heigh; heigh=low; low=t; } n=__________ 4 __________ if(n==0) printf("there are no scores between %d-%d:\n",low,heigh); else { printf("the scores between %d-%d:\n",low,heigh); for(i=0;i<n;i++) printf("%s %4d\n",h[i].num,h[i].score); printf("\n"); } } else printf("Fail!\n"); return 0; }/*main( )函数结束*/ int f(SREC *a,SREC *b,int l,int h) /* b用来存放满足分数条件范围内的学生数据*/ { int i,j=0,n; /*l、h分别用来存放分数范围的下界与上界*/ for(i=0;i<N;i++) { if(a[i].score>=l && a[i].score<=h) { __________ 5 __________; b[j].score=a[i].score; j++; } } return j; }

五、改错

下面程序的功能是打印如图所示的图形。以下程序只允许修改两行。

氺氺氺

氺氺氺氺氺

氺氺氺

#include <stdio.h> int main( ) { int i,j,k,b; for(i=1;i<=5;i++) { b=3-i; for(j=b;j>0;j--) printf(" "); for(k=5-b;k>0;k--) printf("*"); printf("\n"); } return 0; }

下面程序中,creatlist()函数的功能是创建一个带有头结点的链表。ftm()函数的功能是:根据输入的字符,查找链表中的字符数据,如果找到了就输出满足条件的第一个结点位置,如果没有找到,就输出“not found!'以下程序只允许修改三行。

#include <stdlib.h> #include <stdio.h> #define N 5 struct list { char data; struct list *next; } SLIST; SLIST *creatlist(char *a); void fun(SLIST *h,char c) /*c用来存放要查找的字符*/ { SLIST *p; int n=1; int flag=0; /* flag表示是否找到满足条件的结点*/ p=h->next; while(p) { if(p->data==c) { flag=1; continue; } else { n++;p=p->next; } } if(flag) printf("find.the node is %d node \n",n); else printf("not found!\n"); }/*fun()函数结束 */ int main() { SLIST *head; char c;/*c表示要查找的字符,head表示链表的头部*/ char a[N]={'1','2','3','4','5'}; head=creatlist(a); scanf("%c",&c); fun(head,c); return 0; }/*main()函数结束 */ SLIST *creatlist(char *a) { SLIST *h,*p,*q; int i; h=p=(SLIST*)malloc(sizeof(SLIST)); for(i=0;i<N;i++) { q=(SLIST*)malloc(sizeof(SLIST)); q->data=a[i]; p->next=q; q=p; } p->next=0; return h; }

六、程序设计题

一个数列的通项为:an=10n,n=0, 1, 2, 3……,构成了 1, 10,100, 1000,…,把它们连起来,就成了数串:110100100010000…。现从键盘输入一个正整数n(n<10000) 用来表示这个数串的第n位,函数judge()的功能是用来输出数串第n位的值(0或1 )。

#include "stdio.h" int judge(int n) { int i; int k=1; for(i=0; _____ 1 _____; i++,_____ 2 _____) _____ 3 _____ ; return ( _____ 4 _____ ); } int main() { int n; printf("input a number,n="); scanf("%d",&n); printf("the value of %d bit is:%d\n",_____ 5 _____,n); return 0; }

参考答案:

一、选择题

1—3 B、D、A

二、程序填空题

1、sum+s 2、n++ 3、i<n 4、x[i]>ave

三、写程序结果

1、 s1=student! (换行)s2=student! 2、x=1,y=1(换行)x=1,y=2

3、 p=543 4、x=42 5、eabcd

四、程序填空

1、typedef struct student 2、fp=fopen("record.dat","wb")

3、fwrite(std+i,sizeof(SREC),1,fp); 4、f(s,h,low,heigh);

5、strcpy(b[j].num,a[i].num)

五、改错

1、

2016年湖南省对口高考真题中,哪一道题的解答过程最复杂?

L5 { b=(3-i>0?3-i:i-3); 或者 {b=fab(3-i);

L8 for(k=5-2*b;k>0;k--)

2、

L4 typedef struct list

L15 break;

L40 p=q;

六、程序设计题

1、n>=1

2、n-=i

3、k=(n==1)?1:0;

4、k

5、judge(n)

本文共计1918个文字,预计阅读时间需要8分钟。

2016年湖南省对口高考真题中,哪一道题的解答过程最复杂?

一、选择题型+1、在C语言中,函数值类型在定义时可以省略,省略时函数值的隐含类型是__________。A. voidB. intC. floatD. double

二、用scanf函数输入一个字符到数组str中,以下选项中正确的是__________。A. scanf(%c, &str);B. scanf(%s, str);C. scanf(%d, &str);D. scanf(%f, &str);

一、选择题

1、

在C语言中,函数值类型在定义时可以缺省,缺省时函数值的隐含类型是__________。

A.void B.int C.float D.double

2、

用scanf函数输入一个字符串到数组str中,以下选项中正确的语句是__________。

A.scanf("%s",&str); B.scanf("%c",&str[10]);

C.scanf("%s",str[10]); D.scanf("%s",str);

3、

设有定义语句:int m[ ]={2,4,6,8},*k=m;以下选项中表达式的值为6的是__________。

A.*(k+2) B.k+2 C.*k+2 D.*k+=2

二、程序填空题

以下程序的功能是:从键盘输入班级学生的成绩,计算学生成缋的平均分,并输出高于平均分的学生成绩,输入负数表示输入结束,班级人数不超过100人。

#include "stdio.h" int main() { float x[100],sum=0.0,ave,s; int n=0,i; printf("Enter mark:\n"); scanf("%f",&s); while(s>=0.0 && n<100) { sum= _____ 1 _____ ; x[n]= s; _____ 2 _____ ; scanf("%f",&s); } ave=sum/n; printf("Output:\n"); printf("ave=%f\n",ave); for(i=0; _____ 3 _____ ; i++) if( _____ 4 _____ ) printf("%f\n",x[i]); return 0; }

三、写程序结果

下列程序的运行结果是__________。

#include <stdio.h> void f(char *from,char *to) { while ((*to++=*from++)!='\0'); } int main() { char s1[80]="teacher!"; char s2[80]="student!"; f(s2,s1); printf("s1=%s\n",s1); printf("s2=%s\n",s2); return 0; }

下列程序的运行结果是__________。

#include <stdio.h> void f(int x) { static int y=0; x=0; x++;y++; printf("x=%d,y=%d\n",x,y); } int main() { int i; for(i=0;i<2;i++) f(i); return 0; }

3、

下列程序的运行结果是__________。

#include <stdio.h> int p(int n) { int s=0; while(n) { s=s*10+n%10; n=n/10; } return s; } int main( ) { printf("p=%d\n",p(345)); return 0; }

4、

下列程序的运行结果是__________。

#include <stdio.h> #include <string.h> int main() { int i,x=0,t=1; char s[10]="101010"; for(i=strlen(s)-1; i>=0; i--,t<<=1) if(s[i]!='0') x+=t; printf("x=%d\n",x); return 0; }

5、

下列程序的运行结果是__________。

#include <stdio.h> void f(char *p) { char max, *q; int i=0; max=p[i]; while(p[i]!='\0') { if(max<p[i]) { max=p[i]; q=p+i; } i++; } while(q>p) { *q=*(q-1); q--; } p[0]=max; } int main( ) { char str[80] ="abcde"; f(str); puts(str); printf("\n"); return 0; }

四、程序填空

学生的记录由学号和成绩组成,N名学生的数据己放入主函数中的结构体数组s中。 函数creat()的功能是把结构体数组中的数据写入到二进制文件record.dat中。函数f()的功能是:把指定分数范围内的学生数据放在指针b所指的结构体中,分数范围内的学生人数由函数值返问。例如,输入的分数是60、69,则应当把分数在60~69的学生数据输出,包含60分和69分的学生数据。

#include <stdio.h> #include <string.h> #define N 10 __________ 1 __________ { char num[N]; int score; }SREC; int creat(SREC *std) { FILE * fp; int i; if(( __________ 2 __________ )=NULL) return 0; printf("\n output data to file!\n"); for(i=0;i<N;i++) __________ 3 __________ fclose(fp); return 1; }/*creat()函数结束*/ int f(SREC *a,SREC *b,int l,int h); int main( ) { SREC s[N]={{"001",85},{"002",76},{"003",69},{"004",85},{"005",96}, {"006",72},{"007",56},{"008",87},{"009",91},{"010",45}}; SREC h[N]; /*h用来存放满足分数条件范围内的学生数据*/ int i,n,low,heigh,t; /* n用来存放满足分数条件范围内的学生人数*/ int result; /*low、heigh分别用來存放分数范围的下界与上界*/ result=creat(s); /* result表示文件写入操作是否成功*/ if(result) { printf("\n low="); scanf("%d",&low); printf("\n heigh="); scanf("%d",&heigh); if(heigh<low) { t=heigh; heigh=low; low=t; } n=__________ 4 __________ if(n==0) printf("there are no scores between %d-%d:\n",low,heigh); else { printf("the scores between %d-%d:\n",low,heigh); for(i=0;i<n;i++) printf("%s %4d\n",h[i].num,h[i].score); printf("\n"); } } else printf("Fail!\n"); return 0; }/*main( )函数结束*/ int f(SREC *a,SREC *b,int l,int h) /* b用来存放满足分数条件范围内的学生数据*/ { int i,j=0,n; /*l、h分别用来存放分数范围的下界与上界*/ for(i=0;i<N;i++) { if(a[i].score>=l && a[i].score<=h) { __________ 5 __________; b[j].score=a[i].score; j++; } } return j; }

五、改错

下面程序的功能是打印如图所示的图形。以下程序只允许修改两行。

氺氺氺

氺氺氺氺氺

氺氺氺

#include <stdio.h> int main( ) { int i,j,k,b; for(i=1;i<=5;i++) { b=3-i; for(j=b;j>0;j--) printf(" "); for(k=5-b;k>0;k--) printf("*"); printf("\n"); } return 0; }

下面程序中,creatlist()函数的功能是创建一个带有头结点的链表。ftm()函数的功能是:根据输入的字符,查找链表中的字符数据,如果找到了就输出满足条件的第一个结点位置,如果没有找到,就输出“not found!'以下程序只允许修改三行。

#include <stdlib.h> #include <stdio.h> #define N 5 struct list { char data; struct list *next; } SLIST; SLIST *creatlist(char *a); void fun(SLIST *h,char c) /*c用来存放要查找的字符*/ { SLIST *p; int n=1; int flag=0; /* flag表示是否找到满足条件的结点*/ p=h->next; while(p) { if(p->data==c) { flag=1; continue; } else { n++;p=p->next; } } if(flag) printf("find.the node is %d node \n",n); else printf("not found!\n"); }/*fun()函数结束 */ int main() { SLIST *head; char c;/*c表示要查找的字符,head表示链表的头部*/ char a[N]={'1','2','3','4','5'}; head=creatlist(a); scanf("%c",&c); fun(head,c); return 0; }/*main()函数结束 */ SLIST *creatlist(char *a) { SLIST *h,*p,*q; int i; h=p=(SLIST*)malloc(sizeof(SLIST)); for(i=0;i<N;i++) { q=(SLIST*)malloc(sizeof(SLIST)); q->data=a[i]; p->next=q; q=p; } p->next=0; return h; }

六、程序设计题

一个数列的通项为:an=10n,n=0, 1, 2, 3……,构成了 1, 10,100, 1000,…,把它们连起来,就成了数串:110100100010000…。现从键盘输入一个正整数n(n<10000) 用来表示这个数串的第n位,函数judge()的功能是用来输出数串第n位的值(0或1 )。

#include "stdio.h" int judge(int n) { int i; int k=1; for(i=0; _____ 1 _____; i++,_____ 2 _____) _____ 3 _____ ; return ( _____ 4 _____ ); } int main() { int n; printf("input a number,n="); scanf("%d",&n); printf("the value of %d bit is:%d\n",_____ 5 _____,n); return 0; }

参考答案:

一、选择题

1—3 B、D、A

二、程序填空题

1、sum+s 2、n++ 3、i<n 4、x[i]>ave

三、写程序结果

1、 s1=student! (换行)s2=student! 2、x=1,y=1(换行)x=1,y=2

3、 p=543 4、x=42 5、eabcd

四、程序填空

1、typedef struct student 2、fp=fopen("record.dat","wb")

3、fwrite(std+i,sizeof(SREC),1,fp); 4、f(s,h,low,heigh);

5、strcpy(b[j].num,a[i].num)

五、改错

1、

2016年湖南省对口高考真题中,哪一道题的解答过程最复杂?

L5 { b=(3-i>0?3-i:i-3); 或者 {b=fab(3-i);

L8 for(k=5-2*b;k>0;k--)

2、

L4 typedef struct list

L15 break;

L40 p=q;

六、程序设计题

1、n>=1

2、n-=i

3、k=(n==1)?1:0;

4、k

5、judge(n)