川大《程序设计语言(1)1347》19春在线作业

合集下载

20春川大《面向对象程序设计2261》在线作业1(标准答案)

20春川大《面向对象程序设计2261》在线作业1(标准答案)

1.以下不能正确进行字符串赋初值的语句是()。

A.charstr[5]=“good!”B.charstr[]=“good!”C.char*str=“good!”D.charstr[5]={‘g’,‘o’,‘o’,‘d’}答案:A2.如果定义了一个类myclass,则为myclass类对象以成员函数形式重载后运算符的声明应该为()。

A.myclassoperator++()B.myclass& operator++()C.myclassoperatorint++(int)D.myclass& operator++(int)答案:C3.下列语句分别是不同程序中的第一个输入输出语句,若去掉其中的“left”,输出效果将发生变化的是()。

A.coutleftsetfill(~*~)357B.coutleftsetw(5)357C.coutleftsetw(5)“ABCDE”D.coutleft“ABCDE”答案:B4.在每个C++程序中都必须包含有这样一个函数,该函数的名称为()。

A.mainB.MAIND.function答案:A5.下列有关抽象类和纯虚函数的叙述中,错误的是()。

A.拥有纯虚函数的类是抽象类,不能用来定义对象B.抽象类的派生类若不实现纯虚函数,它也是抽象类C.纯虚函数的声明以“0;”结束D.纯虚函数都不能有函数体答案:D6.下面不支持下标操作的容器是()。

A.vectorB.dequeC.listD.map答案:C7.要打开一个文件并从中读取数据,应该使用()类的对象。

A.istreamB.ostreamC.ifstreamD.ofstream答案:C8.二叉查找树按()遍历时访问到节点的数据是排好序的。

A.前序B.中序C.后序D.层次答案:B9.一个类如果没有定义任何函数,编译器不会自动为这个类产生()。

A.拷贝构造函数B.无参构造函数C.输出流运算符D.赋值运算符答案:C10.程序运行中需要从键盘上输入多于一个数据时,各数据之间应该使用()符号作为分隔符。

川大《英汉互译》19春在线作业

川大《英汉互译》19春在线作业

(单选题)1: _____, a man who expresses himself effectively is sure to succeed more rapidly than a man whose command of English is poor.A: Were other things equalB: To be equal to other thingsC: Other things being equalD: Other things to be equal正确答案:(单选题)2: I’m going out to buy ( ) furniture. Will you come along?A: one or twoB: a fewC: a small amount ofD: one or two pieces of正确答案:(单选题)3: Spring ( ) come, we may perhaps look forward to better weather.A: hasB: hadC: haveD: having正确答案:(单选题)4: I like climbing mountains ( ) my wife prefers water sports.A: asB: forC: whileD: when正确答案:(单选题)5: At such a time of crisis, we must try to ______ differences of party or class and stick together.A: set forthB: set backC: set downD: set aside正确答案:(单选题)6: There is not much time left; so I'll tell you about it _________.A: in shortB: in detailC: in briefD: in all正确答案:(单选题)7: ________ twice, the postman refused to deliver our letters unless we chained our dog up.A: Being bittenB: Had been bittenC: Having bittenD: Having been bitten正确答案:(单选题)8: A good artist, like a good engineer, learns as much from ( ) his success. A: his mistakes asB: his mistakes as fromC: his mistakes fromD: his mistakes from as正确答案:(单选题)9: ________ that he refused to help us, there is no reason why we should now help them.A: Being seenB: SeeC: SeenD: Seeing正确答案:(单选题)10: Read the book carefully, ( ) you’ll find lots of information related to our research.A: andB: ifC: orD: so正确答案:(单选题)11: The idea sounds very good but will it work in ( )?A: practiceB: commonC: advanceD: turn正确答案:(单选题)12: Tom ( ) the shopkeeper of overcharging him for the things he had bought. A: scoldedB: accusedC: blamedD: criticized正确答案:(单选题)13: We have _____ to the government for a home improvement loan.A: appliedB: approachedC: apologizedD: appointed正确答案:(单选题)14: The first, second and third prizes went to Jack, Tom and Henry ( ). A: differentlyB: respectivelyC: equallyD: particularly正确答案:(单选题)15: ( ) its economy continues to grow, the US is increasingly becoming a nation of part-time and temporary workers.A: Even thoughB: If onlyC: Now thatD: Provided that正确答案:(单选题)16: The boy ________ Spanish for six years by the time he takes his examination.A: has studiesB: will have studiedC: has been studyingD: had studied正确答案:(单选题)17: They are trying to _______ the waste discharged by the factory for profit. A: exploitB: exhaustC: exposeD: exhibit正确答案:(单选题)18: ( ) against nature for a mother to hurt her own child.A: She isB: That isC: What isD: It is正确答案:(单选题)19: Nowhere else in the world ______ more attractive scenery than in Switzerland.A: you can findB: should be findC: can you findD: has been found正确答案:(单选题)20: The old couple decided to _____ a boy though they already had three of their own.A: adoptB: adaptC: bringD: receive正确答案:(单选题)21: Everyone here, including children and old people, ( ) in for sports. A: goB: goesC: goingD: to go正确答案:(单选题)22: ( ) that he refused to help us, there is no reason why we should now help them.A: Being seenB: SeeC: SeenD: Seeing正确答案:(单选题)23: A good many proposals were raised by the students, ( ) had been expected.A: thatB: whatC: asD: so正确答案:(单选题)24: I’ve never been to Lijiang, but it s the place______.A: where I’d like to visit itB: that I want to visit it mostC: in which I’d like to visitD: I most want to visit正确答案:(单选题)25: The United States is composed of fifty states,( ) are separated from the others by land or water.A: two of whichB: two of whomC: two of themD: two of those正确答案:(单选题)26: The continuous rain ( ) the harvesting of the wheat crop by two weeks. A: set outB: set asideC: set offD: set back正确答案:(单选题)27: You ( ) your classmates if you had made an effort last term.A: had caught up withB: would catch up withC: would have caught up withD: have caught up with正确答案:(单选题)28: ( ) a choice of two jobs, the man decided to take the one which was more challenging.A: When being offeredB: When offeringC: When he is offeredD: When offered正确答案:(单选题)29: When we moved to France, the children ( ) themselves to the new surrounding very well.A: adaptedB: broughtC: were waitingD: have been waited正确答案:(单选题)30: ( ) I admire George as an artist, I do not like him as a man.A: Only ifB: Much asC: If onlyD: As much正确答案:(单选题)31: Nowhere else in the world ( ) more attractive scenery than in Switzerland.A: you can findB: should be findC: can you findD: has been found正确答案:(单选题)32: Do you think it is true that people ( ) against nuclear weapon? A: in particularB: in generalC: in commonD: in question正确答案:(单选题)33: Over thirty coal miners were reported _________ in that shocking accident.A: to be killedB: to have been killedC: having been killedD: being killed正确答案:(单选题)34: I told the foreign guests that it was in the house ( ) we used to live that the exhibition was held.A: thatB: whichC: whereD: there正确答案:(单选题)35: It is reported that yesterday’s traffic accident _____ the death of five passengers.A: resulted fromB: resulted inC: regarded asD: responded to正确答案:(单选题)36: Criticism and self-criticism is necessary ( ) it helps us to correctour mistakes.A: untilB: unlessC: in thatD: in which正确答案:(单选题)37: The lab ____ next year will be advanced than the old one.A: to be builtB: builtC: being builtD: to build正确答案:(单选题)38: They took________ measures to prevent poisonous gases from escaping in the chemical plant.A: fruitfulB: beneficialC: effectiveD: influential正确答案:(单选题)39: Jack was so ( ) the computer game that he didn’t notice my arrival. A: gratefulB: absorber inC: thoughtful ofD: associated with正确答案:(单选题)40: A survey was carried out on cheating in examinations in college all over the country, ________ were surprising.A: such resultsB: the results of whichC: these resultsD: the results of it正确答案:(单选题)1: _____, a man who expresses himself effectively is sure to succeed more rapidly than a man whose command of English is poor.A: Were other things equalB: To be equal to other thingsC: Other things being equalD: Other things to be equal正确答案:(单选题)2: I’m going out to buy ( ) furniture. Will you come along?A: one or twoB: a fewC: a small amount ofD: one or two pieces of正确答案:(单选题)3: Spring ( ) come, we may perhaps look forward to better weather.A: hasB: hadC: haveD: having正确答案:(单选题)4: I like climbing mountains ( ) my wife prefers water sports.A: asB: forC: whileD: when正确答案:(单选题)5: At such a time of crisis, we must try to ______ differences of party or class and stick together.A: set forthB: set backC: set downD: set aside正确答案:(单选题)6: There is not much time left; so I'll tell you about it _________.A: in shortB: in detailC: in briefD: in all正确答案:(单选题)7: ________ twice, the postman refused to deliver our letters unless we chained our dog up.A: Being bittenB: Had been bittenC: Having bittenD: Having been bitten正确答案:(单选题)8: A good artist, like a good engineer, learns as much from ( ) his success. A: his mistakes asB: his mistakes as fromC: his mistakes fromD: his mistakes from as正确答案:(单选题)9: ________ that he refused to help us, there is no reason why we should now help them.A: Being seenB: SeeC: SeenD: Seeing正确答案:(单选题)10: Read the book carefully, ( ) you’ll find lots of information related to our research.A: andB: ifC: orD: so正确答案:(单选题)11: The idea sounds very good but will it work in ( )?A: practiceB: commonC: advanceD: turn正确答案:(单选题)12: Tom ( ) the shopkeeper of overcharging him for the things he had bought. A: scoldedB: accusedC: blamedD: criticized正确答案:(单选题)13: We have _____ to the government for a home improvement loan.A: appliedB: approachedC: apologizedD: appointed正确答案:(单选题)14: The first, second and third prizes went to Jack, Tom and Henry ( ). A: differentlyB: respectivelyC: equallyD: particularly正确答案:(单选题)15: ( ) its economy continues to grow, the US is increasingly becoming a nation of part-time and temporary workers.A: Even thoughB: If onlyC: Now thatD: Provided that正确答案:(单选题)16: The boy ________ Spanish for six years by the time he takes his examination.A: has studiesB: will have studiedC: has been studyingD: had studied正确答案:(单选题)17: They are trying to _______ the waste discharged by the factory for profit. A: exploitB: exhaustC: exposeD: exhibit正确答案:(单选题)18: ( ) against nature for a mother to hurt her own child.A: She isB: That isC: What isD: It is正确答案:(单选题)19: Nowhere else in the world ______ more attractive scenery than in Switzerland.A: you can findB: should be findC: can you findD: has been found正确答案:(单选题)20: The old couple decided to _____ a boy though they already had three of their own.A: adoptB: adaptC: bringD: receive正确答案:(单选题)21: Everyone here, including children and old people, ( ) in for sports. A: goB: goesC: goingD: to go正确答案:(单选题)22: ( ) that he refused to help us, there is no reason why we should now help them.A: Being seenB: SeeC: SeenD: Seeing正确答案:(单选题)23: A good many proposals were raised by the students, ( ) had been expected.A: thatB: whatC: asD: so正确答案:(单选题)24: I’ve never been to Lijiang, but it s the place______.A: where I’d like to visit itB: that I want to visit it mostC: in which I’d like to visitD: I most want to visit正确答案:(单选题)25: The United States is composed of fifty states,( ) are separated from the others by land or water.A: two of whichB: two of whomC: two of themD: two of those正确答案:(单选题)26: The continuous rain ( ) the harvesting of the wheat crop by two weeks. A: set outB: set asideC: set offD: set back正确答案:(单选题)27: You ( ) your classmates if you had made an effort last term.A: had caught up withB: would catch up withC: would have caught up withD: have caught up with正确答案:(单选题)28: ( ) a choice of two jobs, the man decided to take the one which was more challenging.A: When being offeredB: When offeringC: When he is offeredD: When offered正确答案:(单选题)29: When we moved to France, the children ( ) themselves to the new surrounding very well.A: adaptedB: broughtC: were waitingD: have been waited正确答案:(单选题)30: ( ) I admire George as an artist, I do not like him as a man.A: Only ifB: Much asC: If onlyD: As much正确答案:(单选题)31: Nowhere else in the world ( ) more attractive scenery than in Switzerland.A: you can findB: should be findC: can you findD: has been found正确答案:(单选题)32: Do you think it is true that people ( ) against nuclear weapon? A: in particularB: in generalC: in commonD: in question正确答案:(单选题)33: Over thirty coal miners were reported _________ in that shocking accident.A: to be killedB: to have been killedC: having been killedD: being killed正确答案:(单选题)34: I told the foreign guests that it was in the house ( ) we used to live that the exhibition was held.A: thatB: whichC: whereD: there正确答案:(单选题)35: It is reported that yesterday’s traffic accident _____ the death of five passengers.A: resulted fromB: resulted inC: regarded asD: responded to正确答案:(单选题)36: Criticism and self-criticism is necessary ( ) it helps us to correct our mistakes.A: untilB: unlessC: in thatD: in which正确答案:(单选题)37: The lab ____ next year will be advanced than the old one.A: to be builtB: builtC: being builtD: to build正确答案:(单选题)38: They took________ measures to prevent poisonous gases from escaping in the chemical plant.A: fruitfulB: beneficialC: effectiveD: influential正确答案:(单选题)39: Jack was so ( ) the computer game that he didn’t notice my arrival. A: gratefulB: absorber inC: thoughtful ofD: associated with正确答案:(单选题)40: A survey was carried out on cheating in examinations in college all over the country, ________ were surprising.A: such resultsB: the results of whichC: these resultsD: the results of it正确答案:。

四川大学《程序设计语言(1)1347》19秋在线作业1

四川大学《程序设计语言(1)1347》19秋在线作业1

下载前先核对是否是你需要的一套题目,如不是,可能随机出题,下载然后复制
题目在该题库里面查找辅导答案。

《程序设计语言(1)1347》19秋在线作业1
一、单选题(共 20 道试题,共 60 分。


1. 假设整型变量a,b,c的值均为5,则表达式a+++b+++c++的值为()
A. 17
B. 16
C. 15
D. 14
答:C
2. 设变量a是int型,f是float型,i是double型,则表达式10+′a′+i*f 值的类型为()
A. int
B. float
C. double
D. 不确定
答:C
3. 字符型数据在机器中是用ASCII码表示的,字符’5’和’7’在机器中表示为()
A. 10100011和 01110111
B. 01000101和01100011
C. 00110101和00110111
D. 01100101和01100111
答:C
4. 以下叙述正确的是()
A. 函数可以嵌套定义但不能嵌套调用
B. 函数既可以嵌套调用也可以嵌套定义
C. 函数既不可以嵌套定义也不可以嵌套调用
D. 函数可以嵌套调用但不可以嵌套定义
答:D
5. 下面对C语言的描述中,正确的是()
A. 函数一定有返回值,否则无法使用函数
B. C语言函数既可以嵌套定义又可以递归调用
C. 在C语言中,调用函数时,只能将实参的值传递给形参
D. C语言程序中有调用关系的所有函数都必须放在同一源程序文件中
答:C。

2023年川大计算机网络与通信春在线作业

2023年川大计算机网络与通信春在线作业

(单选题)1 : 1 9 0. 2 33.27. 13 是()IP 地址。

A: A类B: B类C: C类I): D 类对的答案:(单选题)2:使用距离矢量路由选择协议的路由器通过以下哪种方式获得最佳途径A:通过向相邻路由器发送一次广播以询问最佳途径B:运营最短途径优先(SPF)算法C:将接受到的途径的度量增长1D:测试每条途径对的答案:(单选题)3:下列功能中,属于表达层提供的功能是()。

A:拥塞控制B:透明传输C:死锁解决D:文本压缩对的答案:(单选题)4: Web上每一个页都有一个独立的地址,这些地址称作统一资源定位器,即()。

A:URLWWWC: HTTPD: USL对的答案:(单选题)5:下面四种答案中,哪一种属于网络操作系统()。

A: DOS操作系统B : Wi n dows9 8操作系统C: WindowsNT操作系统D:数据库操作系统对的答案:(单选题)6:一条线路每1/1 6秒采样一次,传输信号共有16种状态,则其传输速率为()。

A:16b p s4 8 bpsC: 64bps(单选题)13:以下哪个应用是基于ICMP协议应用的?A:文献传输B:电子邮件B:P I NG程序I): BBS对的答案:(单选题)14: HTML语言可以用来编写Web文档,这种文档的扩展名是()。

A:dochtm 或 h t m 1C: txtD: xls对的答案:(单选题)15: In t ernet 称为()。

A:国际互联网B:广域网C:局域网D:世界信息网对的答案:(单选题)16:()是实现数字信号和模拟信号转换的设备。

A:网卡B:调制解调器C:网络线D:都不是对的答案:(单选题)17:主机甲与主机乙之间已建立一个TCP连接,主机甲向主机乙发送了两个连续的TCP段,分别包含300字节和500字节的有效载荷,第•个段的序列号为20 0,主机乙对的接受两个段后,发送给主机甲的确认序列号是()。

A: 500B : 700C: 800I): 1000对的答案:D: 256bps对的答案:(单选题)7:接受端不仅能发现差错,并且能拟定差错发生的位置从而加以纠正的差错控制方法为()。

东大19春学期《C语言及程序设计》在线作业3

东大19春学期《C语言及程序设计》在线作业3

(单选题)1: char*A[5],则标识符A的意义时()。

A: A是一个指向有5个字符型元素的指针变量B: A是一个有5个元素的一维数组,每个元素指向字符型的指针变量C: A是一个指向字符型的函数的指针变量D: A是一个有5个元素的一维数组,每个元素指向整型变量的指针变量正确答案:(单选题)2: C语言中,逻辑“真”等价于()。

A: 大于零的数B: 大于零的整数C: 非零的数D: 非零的整数正确答案:(单选题)3: sizeof(float)是()。

A: 双精度型表达式B: 一个整型表达式C: 一个函数调用D: 一个不合法的表达式正确答案:(单选题)4: 下面正确的字符常量是()A: \X17'B: \80'C: \\'D: """\n"""正确答案:(单选题)5: 若有说明:inta[10];则对数组元素的正确引用是()。

A: a[10]B: "a[3,5]"C: a(5)D: a[10-10]正确答案:(单选题)6: 下列程序的输出为()#includestdio.h;main(){intm=13;floata=12.6,x;x=m/2+a/2;printf(“%f\n” ,x);}A: 12B: 12.3C: 12.8D: 12.3正确答案:(单选题)7: 若有变量说明:inta=0,b=0,c=0;,以下符合C语言语法的赋值表达式是()。

A: a=9+b+c=a+9B: a=9+b;c=a+9;C: "a=(9+b,b++)"D: a=9+b++=a+7正确答案:(单选题)8: 下面程序的输出是()。

main(){intx=10,y=3;printf(“%d\n”,y=x%y);}A: 0B: 1C: 3D: 不确定的值正确答案:(单选题)9: 下述for语句intI,x;for(i=0,x=1,i=9;x!=876;i++)scanf(“%d”,x);A: 最多循环10次B: 最多循环9次C: 无限循环D: 一次也不循环正确答案:(单选题)10: 复制题干,如有插入图片点击第二个“插入多图按钮”插入图片并上传图片A: 单击选项1 粘贴答案,如有图片同样方法插入上传B: 选项内容都是正确答案:(单选题)11: 违约责任的相对性是指违约责任只能发生在( )之间发生。

四川大学《程序设计语言(1)1347》20春在线作业1.doc

四川大学《程序设计语言(1)1347》20春在线作业1.doc

1.C语言程序的执行,总是起始于()A.程序中的第一条可执行语句B.程序中的第一个函数C.main函数 D.包含文件中的第一个函数【参考答案】: C2.语句 PRINT “3.5” +“6.5” +“42”执行的结果是()。

A.52B.3.5 6.5 42C.-1D.3.56.542【参考答案】: B3.用DIM s (4)定义的数组可存放的元素个数为()。

A.4B.5C.6D.7【参考答案】: B4.已知int a=6; 则执行a+=a-=a*a;语句后,a的值为()A.36B.0C.-24D.-60【参考答案】: D5.在C语言中,引用数组元素时,其数组下标的数据类型允许是()A.整型常量B.整型表达式C.整型常量或整型表达式D.任何类型的表达式【参考答案】: C6.下列语句执行后,变量a的值是()。

a = 3:a = 6 END a = 9A.3B.6C.9D.程序有错,a的值不可确定【参考答案】: B7.下面的字符串赋值语句中正确的是()。

A.x = “ABC”B.y$ = ABCC.z$ = “123”D.w$ = 123【参考答案】: C8.已知char ch=′C′;则表达式ch=(ch>=′A′ && ch<=′Z′)?(ch+32):ch;的值是()A.AB.aC.ZD.c【参考答案】: D9.A.3B.9C.–99D.12【参考答案】: C10.表达式“25 MOD(1-2∧2)”的值是()。

A.1B.2C.3D.0【参考答案】: A11.下面的字符串赋值语句中,正确的是()。

A.x = “ ab ”B.y$ = abC.z$ = “ 39 ”D.w$ = 39【参考答案】: C12.下面四个选项中,均是不正确的8进制数或16进制数的选项是()A.016 0x8f 018B.0abc 017 0xaC.010 -0x11 0x16D.0a12 7ff-123【参考答案】: D13.表达式a<B||(C&D)中运算符优先级最高的是()A.||B.&C.D.()【参考答案】: D14.下列说法中错误的是() A)只能在循环体内使用break语句 B)在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环 C)在while和do…while循环中,continue语句并没有使整个循环终止 D)continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断A.只能在循环体内使用break语句B.在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环C.在while和do…while循环中,continue语句并没有使整个循环终止D.continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断【参考答案】: A15.已知x,y,z均为整型变量,且值均为1,则执行语句++x||++y&&++z;后,表达式x+y的值为()A.1B.2C.3D.4【参考答案】: C16.A.6B.24C.30D.32【参考答案】: C17.以下叙述中正确的是()A.构成C程序的基本单位是函数B.可以在一个函数中定义另一个函数 C.main()函数必须放在其他函数之前 D.所有被调用的函数一定要在调用之前进行定义【参考答案】: A18.下面程序的运行结果是()。

川大《C语言程序设计0008》19春在线作业

川大《C语言程序设计0008》19春在线作业

(单选题)1: 设有说明:char a; int b; float c; 则表达式a+b-c值的数据类型为( )。

A: charB: intC: floatD: double正确答案:(单选题)2: 若有定义:int a=8, b=5, c;执行语句c=a/b+0.4; 后, c的值为 ( )。

A: 1.4B: 1C: 2.0D: 2正确答案:(单选题)3: 若有以下定义,则能使值为3的表达式是( )。

int k=7, x=12;A: x%=(k%=5)B: x%=(k– k%5)C: x%=k – k%5D: (x%=k) – (k%=5)正确答案:(单选题)4: 以下选项中合法的实型常数是()。

A: 5E2.0B: E-3C: 2E0D: 1.3E正确答案:(单选题)5: 正确的定义变量是()。

A: int a=10,b,c=2;B: const int a;C: int a=b=c=10;D: int a;b;c正确答案:(单选题)6: C语言中while和do while循环的区别是( )。

A: do while循环至少执行一次B: while的循环条件要求得比do while循环严格C: do while循环允许从外部转到循环体内D: do while循环的循环体部分不能是复合语句正确答案:(单选题)7: 以下程序段的输出结果是()。

int a=1234;printf(“%2dn”, a);A: 12B: 34C: 1234D: 提示出错,无结果正确答案:(单选题)8: 下列运算符中优先级最低的是( )。

A: ?:B: &&C: +D: !=正确答案:(单选题)9: 设a为整型变量,下列表达式中不正确的是()。

A: a=a+1B: a++C: (++a)+1D: a+(1++)正确答案:(单选题)10: 设有以下定义:int a=0; double b=1.25; char c=’a’;#define d 2则下面语句中错误的是()。

四川大学《C语言程序设计0008》20春在线作业1.doc

四川大学《C语言程序设计0008》20春在线作业1.doc

1.若有int x=3;,执行程序段: do { Printf(“%3d”,x-=2); }while (!(--x));输出结果是()。

A.1 3B.1 -1C.1 -2D.1 -3【参考答案】: C2.下面程序段的运行结果是( )。

int n=0; while(n++<=2);printf(“%d”,n);A.2B.3C.4D.有语法错【参考答案】: C3.判断char型变量ch是否为大写字母的表达式是( )。

A.’A’=’A’)||(ch=’A’)&&(ch=ch)【参考答案】: C4.若x的初值为10,则表达式(x>10?x+100 : x-10)的值是( )。

A.10B.0C.100D.1【参考答案】: B5.若以下选项中变量已正确定义,则正确的赋值语句是()。

A.x1=26.8%3B.12=x2C.x3=0x12D.x4=12=3【参考答案】: C6.下列运算符中优先级最高的是()。

A.!B.%C.=D.&&【参考答案】: A7.设a为整型变量, 下列表达式中,错误的是 ( )。

A.a = aB.aC. a 1D.a 1【参考答案】: C8.若变量a、i已定义,且i已正确赋值,合法的语句是()。

A.a==1B.i;C.a=a=5;D.a=int(i);【参考答案】: B9.以下程序段的输出结果是()。

int a=1234; printf(“%2dn”, a);A.12B.34C.1234D.提示出错,无结果【参考答案】: C10.设有定义:char w; int x; float y; double z; 则表达式w*x+z-y 值的数据类型为( )。

A.intB.floatC.doubleD.char【参考答案】: C11.设有以下定义: int a=0; double b=1.25; char c=’a’; #defined 2 则下面语句中错误的是()。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

(单选题)1: C语言程序的执行,总是起始于()A: 程序中的第一条可执行语句B: 程序中的第一个函数C: main函数D: 包含文件中的第一个函数正确答案:(单选题)2: 语句PRINT “3.5” +“6.5” +“42”执行的结果是()。

A: 52B: 3.5 + 6.5 + 42C: -1D: 3.56.542正确答案:(单选题)3: 用DIM s (4)定义的数组可存放的元素个数为()。

A: 4B: 5C: 6D: 7正确答案:(单选题)4: 已知int a=6; 则执行a+=a-=a*a;语句后,a的值为()A: 36B: 0C: -24D: -60正确答案:(单选题)5: 在C语言中,引用数组元素时,其数组下标的数据类型允许是()A: 整型常量B: 整型表达式C: 整型常量或整型表达式D: 任何类型的表达式正确答案:(单选题)6: 下列语句执行后,变量a的值是()。

a = 3:a = 6ENDa = 9A: 3B: 6C: 9D: 程序有错,a的值不可确定正确答案:(单选题)7: 下面的字符串赋值语句中正确的是()。

A: x = “ABC”B: y$ = ABCC: z$ = “123”D: w$ = 123正确答案:(单选题)8: 已知char ch=′C′;则表达式ch=(ch&gt;=′A′ && ch&lt;=′Z′)?(ch+32):ch;的值是()A: AB: aC: ZD: c正确答案:(单选题)9:A: 3B: 9C: –99D: 12正确答案:(单选题)10: 表达式“25 MOD(1-2∧2)”的值是()。

A: 1B: 2C: 3D: 0正确答案:(单选题)11: 下面的字符串赋值语句中,正确的是()。

A: x = “ ab ”B: y$ = abC: z$ = “ 39 ”D: w$ = 39正确答案:(单选题)12: 下面四个选项中,均是不正确的8进制数或16进制数的选项是()A: 016 0x8f 018B: 0abc 017 0xaC: 010 -0x11 0x16D: 0a12 7ff -123正确答案:(单选题)13: 表达式a&lt;B||(C&D)中运算符优先级最高的是()A: ||B: &C: &lt;D: ()正确答案:(单选题)14: 下列说法中错误的是()A)只能在循环体内使用break语句B)在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环C)在while和do…while循环中,continue语句并没有使整个循环终止D)continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断A: 只能在循环体内使用break语句B: 在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环C: 在while和do…while循环中,continue语句并没有使整个循环终止D: continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断正确答案:(单选题)15: 已知x,y,z均为整型变量,且值均为1,则执行语句++x||++y&&++z;后,表达式x+y的值为()A: 1B: 2C: 3D: 4正确答案:(单选题)16:A: 6B: 24C: 30D: 32正确答案:(单选题)17: 以下叙述中正确的是()A: 构成C程序的基本单位是函数B: 可以在一个函数中定义另一个函数C: main()函数必须放在其他函数之前D: 所有被调用的函数一定要在调用之前进行定义正确答案:(单选题)18: 下面程序的运行结果是()。

x = 5:y = 3PRINT x = yENDA: 0B: 5C: 3D: –1正确答案:(单选题)19: 调用gets和puts函数时,必须包含的头文件是()A: stdio.hB: stdlib.hC: defineD: 以上都不对正确答案:(单选题)20: 下列说法中错误的是()A: 只能在循环体内使用break语句B: 在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环C: 在while和do…while循环中,continue语句并没有使整个循环终止D: continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断正确答案:(判断题)21: QBASIC中所有语句都是由语句定义符和语句体共同组成。

A: 错误B: 正确正确答案:(判断题)22: 在程序设计中,数据只能是数字A: 错误B: 正确正确答案:(判断题)23: 注释是QBASIC程序中无关紧要的部分。

A: 错误B: 正确正确答案:(判断题)24: STOP语句的作用是终止程序的运行A: 错误B: 正确正确答案:(判断题)25: WRITE 是QBASIC中合法的变量名。

A: 错误B: 正确正确答案:(判断题)26: QBASIC提供了两个工作窗口。

A: 错误B: 正确正确答案:(判断题)27: 变量和符号常量实质是一样的。

A: 错误B: 正确正确答案:(判断题)28: 在赋值语句中,关键字 LET 可以被省略A: 错误B: 正确正确答案:(判断题)29: 在多重循环中,允许从外层循环转向内层。

A: 错误B: 正确正确答案:(判断题)30: 在程序的运行过程中,可以多次对符号常量进行赋值。

A: 错误B: 正确正确答案:(单选题)1: C语言程序的执行,总是起始于()A: 程序中的第一条可执行语句B: 程序中的第一个函数C: main函数D: 包含文件中的第一个函数正确答案:(单选题)2: 语句 PRINT “3.5” +“6.5” +“42”执行的结果是()。

A: 52B: 3.5 + 6.5 + 42C: -1D: 3.56.542正确答案:(单选题)3: 用DIM s (4)定义的数组可存放的元素个数为()。

A: 4B: 5C: 6D: 7正确答案:(单选题)4: 已知int a=6; 则执行a+=a-=a*a;语句后,a的值为()A: 36B: 0C: -24D: -60正确答案:(单选题)5: 在C语言中,引用数组元素时,其数组下标的数据类型允许是()A: 整型常量B: 整型表达式C: 整型常量或整型表达式D: 任何类型的表达式正确答案:(单选题)6: 下列语句执行后,变量a的值是()。

a = 3:a = 6ENDa = 9A: 3B: 6C: 9D: 程序有错,a的值不可确定正确答案:(单选题)7: 下面的字符串赋值语句中正确的是()。

A: x = “ABC”B: y$ = ABCC: z$ = “123”D: w$ = 123正确答案:(单选题)8: 已知char ch=′C′;则表达式ch=(ch&gt;=′A′ && ch&lt;=′Z′)?(ch+32):ch;的值是()A: AB: aC: ZD: c正确答案:(单选题)9:A: 3B: 9C: –99D: 12正确答案:(单选题)10: 表达式“25 MOD(1-2∧2)”的值是()。

A: 1B: 2C: 3D: 0正确答案:(单选题)11: 下面的字符串赋值语句中,正确的是()。

A: x = “ ab ”B: y$ = abC: z$ = “ 39 ”D: w$ = 39正确答案:(单选题)12: 下面四个选项中,均是不正确的8进制数或16进制数的选项是()A: 016 0x8f 018B: 0abc 017 0xaC: 010 -0x11 0x16D: 0a12 7ff -123正确答案:(单选题)13: 表达式a&lt;B||(C&D)中运算符优先级最高的是()A: ||B: &C: &lt;D: ()正确答案:(单选题)14: 下列说法中错误的是()A)只能在循环体内使用break语句B)在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环C)在while和do…while循环中,continue语句并没有使整个循环终止D)continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断A: 只能在循环体内使用break语句B: 在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环C: 在while和do…while循环中,continue语句并没有使整个循环终止D: continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断正确答案:(单选题)15: 已知x,y,z均为整型变量,且值均为1,则执行语句++x||++y&&++z;后,表达式x+y的值为()A: 1B: 2C: 3D: 4正确答案:(单选题)16:A: 6B: 24C: 30D: 32正确答案:(单选题)17: 以下叙述中正确的是()A: 构成C程序的基本单位是函数B: 可以在一个函数中定义另一个函数C: main()函数必须放在其他函数之前D: 所有被调用的函数一定要在调用之前进行定义正确答案:(单选题)18: 下面程序的运行结果是()。

x = 5:y = 3PRINT x = yENDA: 0B: 5C: 3D: –1正确答案:(单选题)19: 调用gets和puts函数时,必须包含的头文件是()A: stdio.hB: stdlib.hC: defineD: 以上都不对正确答案:(单选题)20: 下列说法中错误的是()A: 只能在循环体内使用break语句B: 在循环体内使用break语句可以使流程跳出本层循环体,从而提前结束本层循环C: 在while和do…while循环中,continue语句并没有使整个循环终止D: continue的作用是结束本次循环,即跳过本次循环体中余下尚未执行的语句,接着再一次进行循环判断正确答案:(判断题)21: QBASIC中所有语句都是由语句定义符和语句体共同组成。

A: 错误B: 正确正确答案:(判断题)22: 在程序设计中,数据只能是数字A: 错误B: 正确正确答案:(判断题)23: 注释是QBASIC程序中无关紧要的部分。

A: 错误B: 正确正确答案:(判断题)24: STOP语句的作用是终止程序的运行A: 错误B: 正确正确答案:(判断题)25: WRITE 是QBASIC中合法的变量名。

A: 错误B: 正确正确答案:(判断题)26: QBASIC提供了两个工作窗口。

相关文档
最新文档