c13a试卷-中文

上传人:luoxia****01803 文档编号:65170771 上传时间:2018-12-30 格式:DOC 页数:8 大小:110KB
返回 下载 相关 举报
c13a试卷-中文_第1页
第1页 / 共8页
c13a试卷-中文_第2页
第2页 / 共8页
c13a试卷-中文_第3页
第3页 / 共8页
c13a试卷-中文_第4页
第4页 / 共8页
c13a试卷-中文_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《c13a试卷-中文》由会员分享,可在线阅读,更多相关《c13a试卷-中文(8页珍藏版)》请在金锄头文库上搜索。

1、浙江大学20132014学年冬季学期程序设计基础及实验课程期末考试试卷课程号: 21186020 ,开课学院: 计算机学院_考试试卷:A卷、B卷(请在选定项上打)考试形式:闭、开卷(请在选定项上打),允许带 入场考试日期: 2014 年 01 月 14 日,考试时间: 120 分钟诚信考试,沉着应考,杜绝违纪.考生姓名: 学号: 所属院系: _ (注意:答题内容必须写在答题卷上,写在本试题卷上无效)试题一、单选题(每小题2分,共20分)1. 在C语言中,下列表达式的值最大的是_.Asizeof(a)Bsizeof(97)Csizeof(“aaaa”)Dsizeof(97.0)2. 以下程序经过

2、编译连接后的可执行文件名是How.exe,执行How are you!,输出结果是_.int main( int argc, char *argv) int len=0;printf(“%c, ”,*(*(argv+1)+1)+1);while (-argc 0) len += strlen( argvargc);printf(“%d”, len);As, 5Bs, 7Cw, 5Dw, 73. 假设a=2, b=2, s=“2“,下列逻辑表达式中值为1(真)的是_.A(s1a) | (a+b) B(ba) & (s2=0)C!(s+1 & b-a)D !ab & (ab)4. 变量a=1, b

3、=1, c=1.0, d=”1”,下列运算不能进行的是_.Ab/a-Ba|!bCc+aDd+a-b5. 设char a=0123456789abc; int i=0, j=10;执行下列哪一条语句所得到的结果和其他三项不同_.Afor (; i=j; i+, -j) ai=aj;Bfor (;i=j;) ai+=aj-;Cwhile (i+ = -j) ai=aj;Ddo ai=aj; while(+i name=”li”;B p-a.year=2000;C w.day=25;Dw.birth.month=10;9. 以下程序段的输出结果是_.char s120=China,s220=for;

4、 if(strcmp(s1,s2) printf(%sn, strcat(s2,s1);else printf(%dn,strlen(s1);A3B5CChinafor DforChina10. 假设a=5,b=1,在执行t = a-b ? (b-a ? a2|b : bb|2之后,t的值为_.A21B11C6D1试题二、填空题(每小题2分,共30分)1. 若整型变量x=2,则表达式1xx4的值为_.2. 已知unsigned short m=65539; 则执行语句printf(%d, m);后的输出结果是_.3. 以下程序的输出是_.#include#define F first %s#d

5、efine D stringvoid main( ) char string = character; printf( F, D );4. 假设a是一个float变量,语句:printf(_);可将a按照保留两位小数的百分率形式输出,例如a=0.32049就应输出32.05%(注意需有百分号).5. 运行以下代码段,则输出结果中有_个“#”.static int a10 = 1*10, i=0;while (ai+) printf(#);6. 下列程序段的输出是_.int c=0,k;for (k=1;k2);printf(%d %dn,k,n);9. 调用函数calc(2, 8) 的返回值是

6、_.int calc(int x, int y) if (!y) return 1; if (y&1) return x*calc(x*x, y1); else return calc(x*x, y1);10. 假设已有结构类型定义:struct point int a, int b ;请用typedef把具有5个上述结构类型元素的数组类型重新命名为RECT,具体形式为:_. 11. 若有以下的定义和语句,则程序段运行的结果是_.struct wc int a;int *b;*p;int x0=11,12, x1=31,32;struct wc x2=100,x0,300,x1;p=x;pri

7、ntf(%d ,*+(+p)-b);12. 以下程序段运行的结果是_.int i,j,sum;for(i=11;i=1;i-=3) for(j=1;j=0; ps-) printf(%s#,ps); 15. 假设所有变量均为整型,则表达式(x=3,y=4,x+,y+=y-=x*=y)的值是_试题三、程序阅读题(每小题5分,共30分)1. 下列程序的输出是_. #includeint t = 2;int fun ( int v, int *u ) static int t = 1; t += 2*u - v; return t;void main( ) int u = 4, v = 3; t +

8、= fun( u, &v ); printf(%d, fun( t, &u ) );2. 如果输入为:AAA22Bb#44dD,那么下面程序的运行结果是.#include void main()char s32, oldc=0, cc;int n = 0;while( (cc=getchar()!=n ) if( cc=oldc ) continue;else if( cc=# )break;else if( cc=a & cc=A & cc=Z )sn+ = oldc = cc;sn = 0;printf(%sn,s);3. 下面程序的运行结果是.#include void down(uns

9、igned n);void up(unsigned n);void down(unsigned n) if(n=2) printf(下);else down(n-2); printf(下); up(n-2); down(n-1); void up(unsigned n) if(n=2) printf(上);else up(n-1); down(n-2); printf(上); up(n-2); void main() down(4);4. 运行以下程序后,将输出_.#include struct node char c; struct node *next;struct node * build(char *s, int *a) struct node *phead=NULL, *pb=NULL, *p; int i=0; while(si != 0) p = (struct node *)malloc(sizeof(struct node); p-

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 中学教育 > 教学课件 > 初中课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号