Visual C++程序设计外文翻译

Visual C++程序设计外文翻译
Visual C++程序设计外文翻译

Visual C++程序设计

21世纪将是信息化社会,以信息技术为主要标志的高新技术产业在整个经济中的比重不断增长,随着计算机技术的飞速发展,社会对人才的计算机应用与开发水平的要求也日益增高,为适应形式,其中VC++技术及其产品是当今世界计算机发展的一块巨大领域。Windows xp/vista 是目前主流图形化操作系统,运行各种各样的window操作系统的个人计算机已在全球的家庭和办公坏境中广泛使用,而越来越多的个人计算机具有internet功能和多媒体功能又推动了对各种各样功能强,速度快的应用软件的进一步需求。目前有一种对microsoft所取得的成功进行诽谤的气氛,然而,microsoft的成功加上它对标准化的承诺,使得有承诺的windows编程人员利用他们掌握的技术在全球范围内得到越来越大的回报,由于西方社会的承认和计算机已越来越深入到每个人的生活中,因而对他们的技术需求与日俱增,从而使得他们的回报、经济收入和其他各方面相应地取得了满意的结果。

Visual C++编程语言是由Microsoft公司推出的目前极为广泛的可视化开发工具,利用Visual C++可以开发基于Widnows平台的32位应用程序,依靠强大的编译器以及网络与数据库的开发能力,用Visual C++可以开发出功能强大的应用程序。

VC++6.0是操作系统中快速应用开发环境的最新版本。它也是当前Windows平台上第一个全面支持最新WEB服务的快速开发工具。无论是企业级用户,还是个人开发者,都能够利用VC++6.0轻松、快捷地开发优秀的基于通信的程序,开发高效灵活的文件操作程序,开发灵活高效的数据库操作程序,等等。VC++6.0是惟一支持所有新出现的工业标准的RAD坏境,包括XML(扩展标记语言)/XSL(可扩展样式语言),SOAP(简单对象存取协议)和WSDL(Web 服务器描述语言)等。

VC++6.0是可视化的快速应用程序开发语言,它提供了可视化的集成开发坏境,这一坏境为应用程序设计人员提供了一系列灵活先进的工具,可以广泛地用于种类应用程序设计。在VC++6.0的集成开发坏境中,用户可以设计程序代码、运行程序、进行程序错误的调试等,可视化的开发方法降低了应用程序开发的难度。VC++6.0的基础编程语言是具有面向对象特性的C++语言。C++具有代

码稳定、可读性好、编译速度快、效率高等优点,并将面向对象的概念得到充分的发挥,使这种语言有了全新的发展空间。

使用VC++6.0,我们几乎可以做任何事情,还可以撰写各种类型的应用程序,动态链接库(DLL)、CON、或CORBA对象,CGI/ISAPI程序,Microsoft Back Office应用程序。程序的规模小到简单的个人数据库应用,大到复杂的企业的多层次分布式系统,都可以使用VC++6.0进行开发,其友好的集成开发界面,可视化的双向开发模式,良好的数据库应用支持高校的程序开发和程序运行,备受广大程序开发人员的好评。尤其是VC++6.0对数据库应用的强大支持,大大提高了数据库应用软件开发的效率,缩短了开发周期,深受广大数据库应用程序设计人员的喜爱。VC++6.0为数据库应用开发人员提供了丰富的数据库开发组件,使数据库应用开发功能更强大,控制更灵活,编译后的程序运行速度更快。

在Visual C++中包含了大量新功能:一些新的控件(例如,你可能在Microsoft Outlook 电子邮件应用程序中日期选择器控件)目前已能应用到你自己的应用程序中。各种图像现在已能与组合框中的项相关联,而且可以利用扩充的组合框控件将图像显示在组合选择框中和下列列表中。在Office 97 和Internet Explorer 4 中已使用的一般的工具条和尺寸可调节的工具条都以集成在其类库中,以供你用于你自己的应用程序中。你可以在你自己的应用程序中使用Internet Explorer,查看Web页和HTML的内容。

面向对象体系结构技术有助于创建行业性软件开发机构。例如交通规划尽管具有差别,但各城市所需要的软件基本上是相同的,这就为软件开发机构提供了一种制作面向交通规划的软件框架(注意这里讲的是软件框架而不是通用性软件)的机会。这种框架一旦开发成功,就可以多次反复利用。

思维方式决定解决问题的方式,传统软件开发采用自顶向下的思想知道程序设计,即将目标分为若干子目标,字母表再进一步划分下去,知道目标能被编程实现为止。面向对象技术是包含数据和对数据操作的代码实体,或者说实在传统的数据结构中加入一些被称为成员函数的过程,因而赋予对象以动作。而在程序设计中,对象具有与现实世界的某种对应关系,我们正式利用这种关系对问题进行分解。

BMP是bitmap的缩写,即为位图图片。位图图片是一种称作“像素”的

单位存储图像信息的。这些“像素”其实就是一些整体排列的色彩(或黑白)点,如果这些点被慢慢放大,你就会看到一个个的“像素中填充着自己的颜色,这些“像素“整齐地排列起来,就成为了一副BMP图片,并以.bmp(.rle,.dib等)为扩展名。BMP(Bitmap-File)图形文件是Windows采用的图形文件格式,在Windows坏境下运行的所有图像处理软件都支持BMP图像文件格式。BMP:Windows位图可以用热河颜色深度(从黑白到24为颜色)存储单个光栅图像。Windows位图文件格式与其他Microsoft Windows程序兼容。它不支持文件压缩,也不适用于WEB页。

从总体上看,Windows位图文件格式的缺点超过了它的优点。为了保证图片图像的质量,请使用PNG文件、JPEG文件或者TIFF文件。BMP文件适用于Windows中的强纸。

优点:BMP支持1位到24位颜色色深度。

BMP格式与现有Windows程序(尤其是较旧的程序)广泛兼容。

缺点:BMP不支持压缩,这会造成文件非常大。

BMP文件不受WEB浏览器支持。

计算机技术迅速发展的时代,图像文件作为传递信息的重要方法之一有着重要作用。每种图像格式都有自己的特点与应用领域,各种图像文件通过格式转换软件实现相互的转换,用户根据自身的需求选择合适的格式以达到最佳的使用效果随着计算机软件、硬件技术的如新月异的发展和普及,人类已经进入一个高速发展的信息化时代,人类大概有80%的信息来自图像,科学研究,技术应用中图像处理技术越来越成为不可缺少的手段。图像处理所涉及的领域有军事应用、医学诊断、工业监控、物体的自动分检识别系统等等,这些系统无不需要计算机提供实时动态、效果逼真的图像。

前言

会议,是人类社会经济生活中不可或缺的一部分,有关的研究表明,通信的有效性约55%依赖于面对面(face-to-face)的视觉效果,38%依赖于说话语音,视听是人们获取信息的最重要形式,而面对面的讨论(face-to-face)是人类表达思想最丰富的一种方式。自工业革命后,科技的发达使得通信技术有了突破性的进展,电话和电报的发明,使远地的人们可以立即传送声音和文档。然而,除了言语的

沟通外,人类更注重的是表情和肢体的表达,仅仅是声音的传送已经无法满足现代人交流的需求,即时并且互动的影像更能真实自然的传送信息。(1)视频会议系统正是在这种迫切需要的推动下产生的新一代通信产品。

视频会议(VideoConference)系统是一种能把声音、图像、文本等多种信息从一个地方传送到另一个地方的通信系统。有效发送基于视频的信息,可以在远程部门和部门间开展合作,同时还可以实现诸如视频会议和视频点播等视频应用技术。视频会议系统是计算机技术与通信技术相结合的产物,它作为多媒体通信技术的一个重要组成部分,正随着波及全球的信息高速公路的兴起而迅速发展起来。

视频会议从出现至今已有三十多年,从最开始的减少旅行费用,提高工作效率,到911时的加速国内外协作,保障人身安全等,再到SARS时保障社会的稳定和各项工作最低限度的运转,视频会议的优越性正在越来越被广泛的显示出来。(2)鉴于视频会议系统在军事、经济、文化等领域给人类带来的巨大作用和经济效益,各国竞相研究和开发视频会议系统,特别是在超大规模集成电路、压缩算法及视觉生理研究方面取得了突破性进展和关于视频会议的一系列国际标准相继出台,以及各种图像实时处理芯片纷纷推出后,视频会议系统的实用化才得到长足的发展。目前国内外的主要应用有:

商务交流

商业会议

企业客户服务和产品开发

远程教学和技术培训

市场调查和情报收集

远程医疗和会诊

科研合作和工程设计

跨国企业应用

招募员工

从目前的发展来看,有关视频会议技术的研究很多,有关的产品也非常丰富,尽管视频会议系统有十分诱人的广阔前景,但在这个领域中还有相当多的技术问题亟待解决,其中在现阶段影响视频会议系统实用性、通用性及友好性的相关技

术和有关问题有:软件技术、数据库技术、网络技术、共享技术、资源控制技术、保密技术和会议模型技术。(3)

本项课题主要研究的是用软件的方式,配合一些必要的外设,实现一个小型视频会议系统。

视频会议系统主要有三个部分组成,即通信网络、会议终端和多点控制单元。视频会议系统实质上是计算机技术和通信技术相结合的产物,所以通信网络是视频会议系统的基础组成部分之一,会议终端是将视频、音频、数据、信令等等各种数字信号分别进行处理后组合成的复合数字码流,再将码流转变为与用户-网络兼容的接口,符合传输网络所规定的信道帧结构的信号格式送上信道进行传输。多点控制单元是视频会议系统用于多点视听信息的传输与切换部分,它是根据一定的准则处理视听信号,并根据要求分配各个要连接的信道,但它并不是视频会议所必须的。(1)

通信网络是一系列的设备、机构和进程,通过它们,附着在网络上的终端用户设备能够进行有意义的信息交换。它涉及到网络传输协议、网络编程接口等内容。(4)

视频会议系统的终端设备承担了多种媒体信息的输入、输出和处理,以及用户和网络之间的连接、交互和控制等多项任务。它属于用户数字通信设备,在系统中处在用户的视听、数据输入/输出设备和网络之间。(1)

视频会议中有时需要进行多点间的信息传输和交换,这时可以借助于多点控制单元(MCU)来实现。多点控制单元实际上就是一台多媒体信息交换机,实现多点呼叫和连接,实现视频广播、视频选择、音频混合、数据广播等功能,完成各终端信号的汇接与切换。MCU将各个终端送来的信号进行分离,抽取出音频、视频、数据和信令,分别送到相应的处理单元,进行音频混合或切换,视频切换、数据广播、路由选择、会议控制、定时和呼叫处理等,处理后的信号由复用器按照H.221格式组帧,然后经网络接口送到指定端口。(5)

Fundamentals of Programming Visual C++

The 21st century are the information societies, unceasingly grow take the information technology as the main symbol high-tech industry in the entire economical proportion,

along with the computer technology rapid development, the society also day by day enhance to talented person's computer application and the development level request, are the adaption situations, VC++ technology and its the product are a huge domain which now the world computer develops. Windows 2000/xp is the present mainstream graph operating system, moves the various Windows operating system personal computer already in the global family and the work environment the widespread use, but more and more many personal computer had the Internet function and the multimedia function impel to be strong to various function, speed quick application software further demand. At present has one kind the success which obtains to Microsoft to carry on the slander the atmosphere, however, the Microsoft success adds on it to the standardized pledge, the technology which enables to have the Windows programmers which pledge uses them to grasp in the global scope to obtain the more and more big repayment, because the western society's acknowledgement and the computer more and more penetrated into in each person's life, thus grows day by day to their technical demand, thus caused them the repayment, the income and other various aspects correspondingly has obtained the satisfactory result.

Visual the C++ programming language is at present extremely widespread visible development kit which promotes by Microsoft Corporation, may develop using Visual C++ based on the Widnows platform 32 applications procedure, depends upon the formidable compiler as well as the network and the database development ability, may develop the function formidable application procedure with Visual C++.

VC++6.0 is in the operating system the rapid application development environment newest edition. It also is in the current Windows platform the first comprehensive support newest Web service fast development kit. Regardless of is the enterprise level user, or individual development, all can be relaxed using VC++6.0, quickly develop outstandingly based on the correspondence procedure, the development highly effective nimble document operation sequence, the development nimble highly effective database operation sequence, and so on. VC++6.0 is the industry standard RAD environment which the only support all newly appears, (expansion mark language) /XSL (may expand style language) including XML, SOAP (simple object

deposit and withdrawal agreement) and WSDL (Web server description language) and so on.

VC++6.0 is the visible fast application procedure development language, it has provided the visible integrated development environment, this environment has provided a series of nimble and the advanced tool for the application programming personnel, may widely use in the type application programming. In the VC++6.0 integrated development environment, the user may design the procedure code, the operating procedure, carries on the program error the debugging and so on, the visible method of exploitation reduced the application procedure development difficulty. The VC++6.0 foundation programming language has the object-oriented characteristic C++ language. C++ has the code stably, the readability good, the translation speed is quick, the efficiency higher merit, and the object-oriented concept will obtain the full display, enable this language to have the brand-new development space Uses VC++6.0 , we nearly may handle any matter, but also may compose plants each kind of type the application procedure, dynamic link storehouse (DLL), CON, or CORBA object, CGI/ISAPI procedure, Microsoft Back Office application procedure. The procedure scale to the simple individual database application, is slightly big to the complex enterprise's multi-level distributional system, all may use VC++6.0 to carry on the development, its friendly integrated development contact surface, the visible bidirectional development pattern, the good database application support highly effective procedure development and the procedure movement, prepares the general procedures development personnel's high praise. VC++6.0 to the database application formidable support, greatly enhanced the efficiency in particular which the database application software develops, reduced the development cycle, deeply general databases application programming personnel's affection. VC++6.0 was the database has provided the rich database development module using the development personnel, caused the database application development function formidable, control more nimble, after the translation procedure running rate was quicker.

In 6.0 has contained the massive new functions in Visual C++: Some new controls (for example, you possibly email application procedure date selector control in

Microsoft in Outlook) at present to be able to apply in you application procedure. Each kind of image could now be connected with the combination frame in item, moreover may use the combination frame which expands to control and following tabulates the pictorial display in the combination choice frame. The tool strip 97 and Internet Explorer in 4 which has used the common tool strip and the size may adjust which in Office all to integrate in its kind of storehouse, by uses in you application procedure for you. You may use Internet Explorer in you application procedure, examines the Web page and the HTML content .

The object-oriented system structure technology is helpful to the foundation prefessional software development organization. For example ,transportation plan although has the difference, but various cities need software basically is same, this provided one kind of manufacture for the software development organization (to pay attention to here lecture face the transportation plan software frame is software frame but was not versatile software) an opportunity. This kind of frame once develops successfully, may repeatedly use many times.

The thinking mode decided solves the question way, the traditional software development uses the from the top thought instruction programming, soon the goal divides into certain subtargets, the subtarget further divides again, can program until the goal the realization. The object-oriented technology brings the enormous change for the software design domain, it carries on the procedure development using the software object, the so-called object is contains the data and the logarithm according to the operation code entity, or said is joins some in the traditional construction of data to be called the member function the process, thus entrusts with the object by the movement. But in the programming, the object has with the real world some kind of corresponding relations, we are precisely use this kind of relations to carry on the decomposition to the question.

BMP is the bitmap abbreviation, namely for position chart picture. The position chart picture is called as "the picture element" with one kind the unit storage picture information. These "the picture element" actually is some neat arrangements colored (or black and white) the spot, if these is slowly enlarged, you can see center adds to

one each one "the picture element" is imitating own color, these "the picture element" neatly arranges, has become a BMP picture, and take bmp (rle, dib and so on) as the extension. BMP (Bitmap-File) the graphic file is the graphic file form which Windows uses, moves all imagery processing software under the Windows environment all to support the BMP image document format. BMP: The Windows position chart may (as black and white use any color depth from as 24 colors) to save the single diffraction grating picture. The Windows position chart document format and other Microsoft the Windows procedure is compatible. Its supporting documentation compression, also ill uses in the Web page.

Looked from the overall that, the Windows position chart document format shortcoming has surpassed its merit. In order to guarantee the picture picture the quality, please use the PNG document, the JPEG document or the TIFF document. The BMP document is suitable in Windows the wallpaper. Merit: BMP supports 1 to 24 colors depths. The BMP form and the existing Windows procedure (an older procedure) widespread is in particular compatible. Shortcoming: BMP does not support the compression, this can create the document to be extremely big. BMP document not Web browser support.

The computer technology rapid development time, the picture document has the vital role one of as transmission information important methods. Each kind of picture form all has own characteristic and the application domain, each kind of picture document through the format conversion software realization mutual transformation, the user acts according to own demand choice appropriate form to achieve the best use effect. The development and the popularization which along with computer software, the hardware technology changes with each new day, the humanity already entered a high speed development the information time, the humanity probably has 80% information to come from the picture, in the scientific research, the technical application the picture processing technology more and more to become the essential method. Picture processing involves the domain has the military application, medicine diagnosis, industry monitoring, the object automatic minute examines recognition system and so on, these systems need the computer to provide the real-time tendency all, the effect

lifelike picture.

1 Introduction

Meeting of human society an integral part of economic life, the study shows that approximately 55% of the effectiveness of communication depends on the face (face-to-face) of the visual effects, 38% rely on talking voice, audio-visual people The most important form of access to information, and face to face discussions (face-to-face) is the most abundant human expression of ideas way. Since the industrial revolution, the technological advancement made a breakthrough progress in communication technology, telephone and telegraph invention of the distant sound of people and documents can be sent immediately. However, in addition to verbal communication, the human beings pay more attention to facial expressions and body expression, only voice transmission has been unable to meet the needs of modern communication, real-time video and interactive delivery of information more real and natural. (1) video conferencing system is in this generation, driven by an urgent need for a new generation of communications products.

Video Conferencing (VideoConference) system is a can sounds, images, text and other information sent from one place to another communication system. Effective transmission of video-based information on a remote sector and intersectoral cooperation, and also can be achieved, such as video conferencing and video applications such as video on demand technology. Video conference system is the computer technology and communication technology product of the combination, multimedia communication technology as an important part of being affected with the rise of the global information superhighway and has developed rapidly.

Video conferencing has been thirty years from the emergence, from the beginning to reduce travel costs, improve efficiency, to 911 domestic and international collaboration to accelerate the time to protect the personal safety, to safeguard social stability during SARS and the minimum work operation, the advantages of video conferencing is increasingly widely displayed. (2) In view of the video conference system in the military, economic and cultural fields, the enormous role of the human and economic, national research and development of competing video conferencing systems, especially in very large scale integrated circuits, compression algorithms and visual physiology research breakthrough has been made and on a series of international standards for video conferencing were introduced, and a variety of image processing chips have the introduction of real-time video conferencing systems have come a long way before the practical development. The main application at home and abroad are:

Business Communication

Business Conference

Enterprise customer service and product development

Distance learning and technical training

Market research and intelligence gathering

Telemedicine and consultation

Cooperation in scientific research and engineering design

Multinational application

Staff recruitment

From the current perspective of the development, research on a lot of video conferencing technology, the products are very rich, although very attractive video conferencing system has broad prospects, but in this area there are considerable technical issues to be resolved, video conferencing systems at this stage of practicality, versatility and friendliness of the relevant technologies and related issues: software technology, database technology, network technology, sharing of technology, resource control, security technology and technology conference model. (3)

The main research topics is the way of software, with the necessary peripherals to achieve a small video conferencing system.

2, the basic principles of video conferencing systems

Video Conferencing (VideoConference) system is the basic definition: two or more individuals or groups of different geographic location, through the transmission line and multimedia equipment, the sound, image, video, interactive video and file transfer data, to instant and interactive communication in order to complete the purpose of the conference system. Be read from above, video conferencing is a typical multimedia communications, the next diagram is a diagram of a typical video conferencing system:

Figure 1.1 A typical schematic of a video conferencing system

From the above diagram we can basically tell, the video conferencing system has three main components, namely, communication networks, conferencing terminals and multipoint control unit. Video conferencing systems and computer technology is essentially the product of combining communication technology, so the communication network is based video conferencing system component of the terminal session is video, audio, data, signaling, and so a variety of digital signals, respectively after combined into the composite digital stream, and then transforms to a code with the user - Network compatible interface, in line with the provisions of the transmission network of the frame structure of the channel to send the channel signal format for transmission. Multipoint control unit is multi-point video conferencing system, audio-visual information for transmission and switching part, which is based on certain criteria for audio-visual signal processing, and on request allocation of each channel to be connected, but it is not necessary for video conferencing. (1) Communication network is a series of devices, institutions and processes, through them, attached to the end user devices on the network can be a meaningful exchange of information. It relates to the network transport protocol, network programming interfaces and so on. (4)

Video conferencing system has undertaken a variety of media terminal device information input, output and processing, and the connection between the user and network, interact and control a number of tasks. It belongs to the user digital communication equipment, in the system at the user's audio, data input / output devices and networks. (1)

Sometimes the need for video conferencing between multiple points of information transmission and exchange, then you can control unit by means of multi-point (MCU) to achieve. Multipoint control unit is actually a multimedia information exchange, multi-point call and connection, to achieve video broadcasting, video selection, audio mixing, data broadcasting and other functions, the completion signal of the terminal tandem with the switch. MCU signals sent by the various terminals to separate, extract audio, video, data and signaling, respectively, corresponding to the processing unit, or switch audio mixing, video switching, data broadcasting, routing, session control, timing, and call processing, the processed signal from the multiplexer in accordance with the H.221 format, framing, and then sent to the designated port by the network interface. (5)

C语言程序设计第三版习题库答案

C 语言程序设计(第三版)习题库 1、设圆半径r=,圆柱高h=3,求圆周长、圆面积、圆球表面积、圆球体积、圆柱体积。用scanf 输入数据,输出计算结果,输出时要求文字说明,取小数点后两位数字。请编程序。 #include<> main(){ floatr,h,C1,Sa,Sb,Va,Vb; scanf(__”%f ”__,&r); scanf(”%d ”,__&h _);; C1=2**r; Sa=*r*r; Sb=4*Sa; Va=4**r*r*r/3; Vb=Sa*h; printf(___”Cl=%.2fSa=%.2fSb=%.2fVa=%.2fVb=%.2f ”,Cl,Sa,Sb,Va,Vb ); } 2、输入一个华氏温度,要求输出摄氏温度。公式为c=5(F-32)/9 输出要求有文字说明,取位2小数。 #include<> main(){ floatF,c; scanf("%f",&F); ____c=5*(F-32)/9______; printf("c=%.2f",c); } 3、有一函数:?? ???≥-<≤-<=10113101121x x x x x x y 写一程序,输入x 值,输出y 值。 #include<> main(){ intx,y; printf("输入x :"); scanf("%d",&x); if(x<1){/*x<1*/ y=x; printf("x=%3d,y=x=%d\n",x,y);

}elseif(____x<10_______){/*1≤x-10*/ _____y=2*x-1_______; printf("x=%3d,y=2*x-1=%d\n",x,y); }else{/*x≥10*/ y=3*x-11; printf("x=%3d,y=3*x-11=%d\n",x#include"" main() { intx,y; scanf("%d",&x); if(x<1) {y=x;} elseif(x>=1&&x<10) {y=2*x-1;} else {y=3*x-11;} printf("%d",y); }#include"" main() { intx,y; scanf("%d",&x); if(x<1) {y=x;} elseif(x>=1&&x<10) {y=2*x-1;} else {y=3*x-11;} printf("%d\n",y); }#include"" main() { intx,y; scanf("%d",&x); if(x<1) {y=x;} elseif(x>=1&&x<10) {y=2*x-1;} else {y=3*x-11;} printf("%d",y); }scanf("%d",&x);

《程序设计基础》试卷B及答案

黄淮学院计算机科学系2007-2008学年度第一学期 期末考试《程序设计基础》B 卷 注意事项:本试卷适用于计科系06级本科计算机科学与技术专业学生。 1.__ ____函数是程序启动时惟一的入口。 2.算法的复杂性包含两方面: 和 。 3.已知 char c= 'a' ; int x=2,k; 执行语句k=c&&x++ ; 则x 为 ,k 为 。 4.数值0x34对应的十进制为 。 5.已知int a ; 则表达式”(a=2*3 , 3*8), a*10”的结果为_ _ ____,变量a 的值为___ ___。 6.面向对象程序开发步骤为: 、 和面向对象实现。 1.下列程序设计语言中( )是面向对象语言。 A. FORTRAN B. C 语言 C. C++ D. 汇编语言 2.下列关于注释的说法哪个是错误的( )。 A. 注释不是程序中的可执行语句 B. 注释对于程序的执行有很重要的意义 C. 注释将在程序的编译阶段被编译器剔除 D. 编程时在程序中添加适当的注释是一个良好的编程风格 3.算法设计应该遵守( )的设计原则。 A. 自底向上,逐步求精 B. 自顶向下,逐步求精 C. 自底向上,同步扩展 D. 自顶向下,同步扩展 4.下列语句执行后a 的值为( )。 int a=4, &z=a, k=3; a=k; z+=2; k++; A. 0 B. 4 C. 1 D. 5 5.以下程序执行后,屏幕输出为( )。 #include “iostream.h ” void fun(int d) {d++;} void main() { int d=3; fun(d); d++; cout<=’a ’)&&(d<=’z ’) B. ‘a ’<=d<=’z ’ C. (d>=’a ’)||(d<=’z ’) D. ‘A ’<=d<=’Z ’ 8.已知:int k=7, x=12; 则执行语句( )后x 的值为0。 A. x+=k-x%5; B. x+=(x-k%5); C. x%=(k-=5); D. (x-=k)-(k+=5); 9.运行下列程序,其输出结果为( )。 #include “iostream.h ” void main() { int x(5),y(5),z(5); y--&&++x&&z--||y++; cout<

C语言程序设计试题集与答案解析

一.填空 1. 每个C程序都必须有且仅有一个________ 函数。 2. C语言程序开发到执行通常要经过6个阶段即编辑、预处理、________、链接、加载和执行。 3. 软件是程序,以及______、使用和维护所需要的所有文档。 4. 国标中规定:“计算机程序是按照具体要求产生的适合于计算机处理的_________”。 5. 程序设计语言按照书写形式,以及思维方式的不同一般分为低级语言和________两大类。 6. C语言是由________组成的。 7. C语言的函数可分为主函数main、标准库函数和_________。 8. 一个函数是由两部分组成的,即:________和函数体。 9. 编译是将C语言所编写的源程序________成机器代码,也称为建立目标代码程序的过程。 10. 程序是由某种程序设计语言编制出来,体现了编程者的控制思想和对计算机执行操作 的要求。不同的任务功能,就会需求不同的软件程序,如:控制计算机本身软硬件协调工作,并使其设备充分发挥效力,方便用户使用的系统软件程序,称为操作系统;而为办公自动化(OA)、管理信息系统(MIS)、人工智能、电子商务、网络互联等等应用而开发的软件程序,统称为_________。 11. 机器语言是以__________形式表示的机器基本指令的集合,是计算机系统唯一不需要翻译可以直接识别和执行的程序设计语言。 12. 与机器语言相比,使用汇编语言来编写程序可以用_______来表示指令的操作码和操作对 象,也可以用标号和符号来代替地址、常量和变量。

13. 在编译程序之前,凡以____开头的代码行都先由预处理程序预处理。 14. C程序的执行均是由执行_________开始。 15. 函数体即为包含在{}内的部分。它分为________和为完成功能任务由若干个C 语句 组成的执行部分。 16. C语言程序中一条简单语句是以________字符作为结束符的。 17. C语言是结构化、________的程序设计语言。 18. 由于计算机硬件不能直接识别高级语言中的语句,因此,必须经过“_______程序”,将用高级语言编写的程序翻译成计算机硬件所能识别的机器语言程序方可执行。 19. 用高级语言编写的程序需翻译成计算机硬件所能识别的机器语言程序方可执行。所以 说,用高级语言进行程序设计,其编程效率高,方便易用,但_______没有低级语言高。 20.

程序设计基础试题和答案解析二

《程序设计基础》考试试卷二 1.1966年,Bohra和Jacopini提出的三种基本程序设计结构是:________ A.if、while和for; B. switch、do-while和for; C.while、do-while和for; D.顺序结构、分支结构和循环结构。 2.算法的特征不包括:______。 A.有穷性 B.可行性 C.确定性 D.有1个或者多个输入。 3.C语言源程序的基本组成单位是______。 A.函数 B. 语句 C. 声明和语句 D. 文件 4.下列标识符中,只有______是合法的。 A.if B. 3ab C. Int D. A-4 5.下列常量中,只有______是合法的。 A.3e-0.3 B. ‘abc’ C. 02a1 D. ‘\377’ 6.下列说法中正确的是:______。 A.C语言中的for语句的三个表达式都可以省略,而且分号也可以省略。 B.宏替换比函数调用的执行速度慢。 C.实质上,C语言中的指针就是一个变量的地址。 D.C语言中的任何函数都可以由程序员命名。 7.C语言中,运算对象必须是整型的运算符是_______。 A./ B. % C. + D. - 8.以下叙述中错误的是_______。 A.C语句必须以分号结束 B.复合语句在语法上被看作一条语句 C.空语句出现在任何位置都不会影响程序运行 D.赋值表达式末尾加分号就构成赋值语句 9.以下叙述中正确的是_______。 A.调用printf函数时,必须要有输出项 B.使用putchar函数时,必须在之前包含头文件stdio.h C.在C语言中,整数可以以十二进制、八进制或十六进制的形式输出 D.调用getchar函数读入字符时,可以从键盘上输入字符所对应的ASCII码10.以下关于函数的叙述中正确的是_______。 A.每个函数都可以被其它函数调用(包括main函数) B.每个函数都可以被单独编译 C.每个函数都可以单独运行 D.在一个函数内部可以定义另一个函数 11.有以下程序段typedef struct NODE{ int num; struct NODE *next;

《高级语言程序设计》复习题及答案

一、选择题 1.以下叙述正确的是( ): A)在C程序中,main函数必须位于程序的最前面 B) C程序的每行只能写一条语句 C) C语言使用库函数实现输入输出操作 D)注释中的拼写错误会影响编译结果 2、以下说法中正确的是() A) C语言程序总是从第一个的函数开始执行 B) C语言程序总是从main()函数开始执行 C)在C语言程序中,要调用的函数必须在main()函数中定义 D)C语言程序中的main()函数必须放在程序的开始部分 3、下列选项种说法正确的是( ) A)函数由声明部分和执行部分两部分组成 B)语言中main函数一定在程序的开始部分 C)C语言程序总是从第一个定义的函数开始执行 D)C程序的每行中只能写一条语句 4、设有说明:int a;float b; char c; double d; 则表达式1.3*a+2*b*c+d*(int) 2.6 值的类型为( )。 A)doubleB) char C) floatD) int 5、C语言的标识符只能由字母、数字和下划线三种字符组成,且第一个字符( ) A)必须为字母 B)必须为下划线 C)必须为字母或下划线 D)可以是字母、数字和下划线中任一种字符 6、以下不正确的C语言标识符是( )。 A) ABC B) abc C)a_bc D) void 7、下列运算符中优先级最高的是( ) A)< B)+ C)&& D)!= 8、以下选项中属于C语言中合法关键字的是( ) A)Float B)abc C)int D)CASE 9、若x、i、j和k都是int型变量,计算下面表达式后,x的值为( ) x=(i=4,j=16,k=32) A)4 B)16 C)32 D)52 10、在C语言中,要求数据必须是整型的运算符是( ) A)/ B)+ + C)!=D) % 11、若整型变量x的值为8,则下列表达式中值为1的表达式是 A)x+=x-=x B) x%=x-1 C) x%=x%=3 D) x/=x+x 12、若w=1,x=2,y=3,z=4,则条件表达式“w > x? w : y< z ? y : z”的值是( ) A)4 B)3 C)2 D)1 13、有以下程序,程序运行后的输出结果是。 main() {inti=1,j=2,k=3; if(i++==1&&(++j==3||k++==3)) printf("%d %d %d\n",i,j,k); }

C语言程序设计基础试题及答案

第一部分C语言基础 一、选择题 1、以下正确得C语言标识符就是() A。%X B。a+b?C.a123 D.test! 2、已定义int a,b;则以下不正确得C语句就是() A.a*=5;??B。b/=2;? C.a+=1、75;?D.b&&=a; 3、若x、i、j与k都就是整型变量,则执行下面表达式后x得值为( ) x=(i=4,j=16,k=32) A.4?B.16 ?C.32 D.52 4、C语言中得标识符只能由字母、数字与下划线三种字符组成,且第一个字符( ) A.必须就是字母???B.必须为下划线? C.必须为字母或下划线D.可以就是字母、数字、下划线中得任一字符 5、下面正确得字符常量就是( ) A.“c”? B。’\\”? C.‘w’??D.” 6、设int a=2,b=0,c;则执行语句c+=b&&a--后, c得结果为( )。 A.0,1B.1,0 ?C.2,0 D.不确定 7、以下不正确得C语言标识符就是()?A) int B)a_1_2?C)ab1exe D)_x 8、以下就是正确得C语言标识符就是( )。?A)#define?B)_123 C) %d D) \n 9、下列四组字符串中都可以用作C语言程序标识符得一组就是() 。?A) prin tB)i\am C)Pxq D)str_l ???oodbs tart$it line# _3d one_half My-〉bookCpp ? pow 10、下面各选项组中,均就是C语言关键字得组就是()。?A)auto,enu

m,include B)switch,typedef,continue?C)signed,union,scanf?D)if,s truct,type 11、下列不属于C语言关键字得就是( ) 。 A)default?B)register C)enum ?D)external 12、C语言程序从main()函数开始执行,所以这个函数要写在( )。?A) 程序文件得开始?B)程序文件得最后?C)它所调用得函数得前面 D) 程序文件得任何位置 13、下列关于C语言得叙述错误得就是( ) A)大写字母与小写字母得意义相同?B) 不同类型得变量可以在一个表达式中 C)在赋值表达式中等号(=)左边得变量与右边得值可以就是不同类型?D) 同一个运算符号在不同得场合可以有不同得含义 14、在C语言中,错误得int类型得常数就是( ) 。?A)32768?B)0 C)037?D) 0xAF 15、将字符g赋给字符变量c,正确得表达式就是( )。 A) c=\147 ?B)c="\147" ?C)c='\147' 16、下列转义字符中错误得一个就是( )。 A) ’\000’ B)'\0014' ?C) ’\x111’ D) ’\2’ 17、将空格符赋给字符变量c,正确得赋值语句就是( )。 A) c=’\0’ B) c=NULL C)c=0 D)c=32 18、已知:char a=’\70’;则变量a中()。 A)包含1个字符?B)包含2个字符?C) 包含3个字符?D) 说明非法 19、字符串"\”EOF\n=-\61\””得长度就是( )。 A)8 ?B) 9?C)14?D)非法字符串

c语言程序设计第五版习题答案

习题解析与答案 第1章C语言概述 一.简答题 1.概述C语言的主要特点。 【解答】 (1)语言简洁、紧凑,使用方便、灵活。 (2)数据类型丰富,表达能力强。 (3)运算符多样。C语言中的运算符包含的范围非常广泛。 (4)具有结构化的控制语句。如if…else语句、while语句、do while语句、switch 语句、for语句。 (5)允许直接访问物理地址。C语言中含有的位和指针运算,能够直接对内存地址进行访问操作。 (6)所生成的目标代码质量高,可移植性好。 2.构成C语言程序的基本单位是什么?它由哪几部分组成? 【解答】函数是构成C语言程序的基本单位。一个完整的C程序一般由文件包含、宏定义、函数说明、变量和一个或若干个函数组成。 3.C语言程序的运行一般要经过哪几个步骤? 【解答】(1)编辑;(2)编译;(3)连接,生成EXE文件;(4)执行。 二.运行程序写结果 1.输入下面程序并运行。 main() { int a1,a2,x; a1=100; a2=50; x=a1-a2; printf(″x=%d\n″,x); } 【解答】运行结果为:x=50 2.输入下面程序并运行。 main() { int a1,a2,x; a1=10; a2=20; x=a1*a2; printf(″a1=%d,a2=%d\n″,a1,a2); printf(″x=%d\n″,x); } 【解答】运行结果为:a1=10,a2=20 x=200 3.输入下面程序并运行。

#include main() { printf("******\n"); printf(" *****\n"); printf(" ****\n"); printf(" ***\n"); printf(" **\n"); printf(" *\n"); } 【解答】运行结果为:****** ***** **** *** ** * 思考:可以修改程序,使之输出平行四边形,等腰三角形等图形。 三.编程题 1.参照本章例题,编写一个C程序,用于显示如下信息: ************************* I love C programs! ************************* 【分析与提示】 ①要有文件包含语句#include 。C语言中没有数据的输入、输出等功能,数据的输入、输出都是通过调用系统提供的库函数scanf和printf等来实现的。这些函数的说明都包括在stdio.h文件中。 ②main是主函数的名称。用{}括起来的内容是函数体,函数体由若干条语句组成,这是计算机要执行的部分,每条语句以分号“;”结束。 ③注意显示的信息有三行,所以要用到换行符“\n”。 参考代码: #include main() { printf("************************\n"); printf(" I love C programs! \n"); printf("************************\n"); }

《程序设计基础》试卷(A卷)

《程序设计基础》试卷(A 卷) 注意:1、考试时间: 90 分钟; 2、班级、姓名、学号必须写在指定地方; 3、适用班级: 4、考试方式: 一、填空题 (每空 2 分,共 20 分) 1、C 程序是由函数构成的,其中有且只能有 1 个主函数,每个C 程序总是从它开始执行,并且以 ; 作为结束符。 2、C 语言中三大基本结构有:顺序结构、 选择结构 、 循环结构 。 3、‘A ’+3的结果是 68 。 4、若已定义x 和y 为double 类型,则表达式x=1,y=x+3/2 的值是 2.5 。 5、C 语言中逻辑运算符 ! 的优先级高于算术运算符。 6、符号“a”和‘a’的区别是 “a ”2字节 ‘a ’1字节 。 7、C 语言的预处理语句以____#_____开头。 8、有如下输入语句:scanf(“a=%d,b=%d ,c=%d”,&a ,&b ,&c );为使变量a 的值为1,b 的值为3,c 的值为2,从键盘输入数据的正确形式应是 a=1,b=3,c=2 。 二、选择题 (每小题 3 分,共 30 分) 1、下列叙述中错误的是( D )。 A 、 if 语句允许用户选择是否执行某个操作。 B 、 if else 语句允许用户选择执行两个操作中的某个操作。 C 、 switch 语句允许用户选择执行多个操作中的某个操作 D 、 多分支选择结构只能使用switch 语句实现 2、以下不正确的C 语言标识符是( D ) A 、ABC B 、abc C 、a_bc D 、ab.c 3、按照C 语言规定的用户标识符命名规则,不能出现在标识符中的是( B )。 A 、大写字母 B 、连接符 C 、数字字符 D 、下划线 4、将int 型变量n 转换成float 型变量的方法是( B )。 A 、float n B 、(float)n C 、float(n) D 、(int )n 5、( A )是构成C 语言的基本单位。 A 、函数 B 、子函数 C 、过程 D 、子过程 6、下面关于运算符优先顺序的描述中正确的是( B )。 A 、关系运算符< 算术运算符< 赋值运算符< 逻辑与运算符 B 、逻辑运算符< 关系运算符< 算术运算符< 赋值运算符 C 、赋值运算符< 逻辑与运算符< 关系运算符< 算术运算符 D 、算术运算符< 关系运算符< 赋值运算符< 逻辑与运算符 7、在C 语言中,要求参加运算的数必须是整数的运算符是( C )。 A 、/ B 、! C 、% D 、= = 8、char 型常量在内存中存放的是( B )。 A 、ASCII 代码值 B 、BCD 代码值 C 、内码值 D 、十进制代码值 9、以下程序的输出结果是( B ) Main() { Int x=10,y=4; Printf(“%d\n ”,x/y);

《高级语言程序设计》答案

1. 输入两个整数,要求用两个函数求出其最大公约数和最小公倍数,最大公约数和最小公倍数都在主函数中输出。#include int main() { int i,j,t; int max(int,int); int min(int,int); scanf("%d%d",&i,&j); if(i int main() { int max4(int,int,int,int); //对max4的函数声明 int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); //输入4个数 printf("max=%d\n",max4(a,b,c,d));//调用4个数中的最大者 return 0; } int max4(int a,int b,int c,int d) //定义max4函数 { int max2(int,int); //对max2的函数声明 return max2(max2(max2(a,b),c),d); //调用max2把作为函数值带回main函数} int max2(int a,int b) { return(a>b?a:b); //返回条件表达式的值,即a和b中的大者 } 3. 用递归调用的方法求5!。 #include int main() { int fac(int); int n; scanf("%d",&n);

年C语言程序设计基础期末考试试卷‘B’及答案

年C语言程序设计基础期 末考试试卷‘B’及答案 The following text is amended on 12 November 2020.

一、单项选择题 1. 在C语言中,下面字符串能用作变量名的是( )。 A、a+b B、auto C、2-and D、a2 2. 若double x=2,y;则执行y=x+3/2;后,y的值是( )。 A、 B. C. D. 3 3. 下列关于C语言中字符常量与字符串常量的叙述中,错 误的是( )。 A、字符常量是用单撇号括起来的一个字符 B、空格字符也可用作字符常量 C、字符串常量是用单撇号括起来的一个字符序列 D、字符串常量是用双撇号括起来的一个字符序列 4. 若有以下变量说明和数据的输入方式,则正确的输入语 句为( )。

变量说明:float x1,x2; 数据的输入方式:<回车> <回车> A、scanf(“%f,%f”,&x1,&x2); B、scanf(“%f%f”,&x1,&x2); C、scanf(“%,%”,&x1,&x2); D、scanf(“%%”,&x1,&x2); 6. 在一个源文件中定义的全局变量的作用域为()。 A. 本文件的全部范围 B. 从定义该变量开始至本文件结束 C. 本函数的全部范围 D. 本程序的全部范围

7. 当调用函数时,实参是一个数组名,则向函数传送的是( )。 A、数组的长度 B、数组的首地址 C、数组每一个元素的地址 D、数组每个元素中的值 8.若j为整型变量,则下面while循环( )。 j=10; while(j!=0) j=j-1; A、执行0次 B、执行1次 C、执行10次 D、执行无限次 9. 在while(x)语句中的x与下面条件表达式等价的 是:( )。 A、x!=0 B、 x==1 C、x!=1 D、x==0 10. 以下对C语言函数的描述中,正确的是( )。 A、调用函数时,参数可以是表达式

(完整版)C语言程序设计练习及答案

《C语言程序设计》练习及答案 得分评卷人复查人 一、单选题,每小题1分,共60分(将正确答案的序号写在题目的括号中)。 1、结构化程序设计的三种基本控制结构是(D )。 A、主程序、子程序、函数 B、输入、处理、输出 C、调用,返回,转移 D、顺序、选择、循环 2、下列关于C程序变量的叙述, ( D )是错误的。 A、变量名必须由字母或下划线开头。 B、程序中的变量必须在被使用之前定义。 C、不同的基本类型的变量之间可以混合运算。 D、变量的数据类型决定变量的"作用域"。 3、能将C语言编写的源程序转换为目标程序的软件是(C )。 A、编辑程序 B、汇编程序 C、编译程序 D、解释程序 4、以下符号中,合法的用户标识符是( D )。 A、-p B、int C、3ab D、_xt_ 5、以下选项中,与m=n++完全等价的表达式是( C )。 A、m=++n B、m+=n+1 C、m=n, n=n+1 D、n=n+1,m=n 6、若有定义:int aa[8];。则以下表达式中不能代表数组元aa[1]的地址的是(C )。 A、&aa[0]+1 B、&aa[1] C、&aa[0]++ D、aa+1 7、表达式!5&(7+3)&&(4+5)的值是(A)。 A、0 B、1 C、5 D、9 8、以下选项中非法的C语言表达式是(A )。 A、x+1=x+1 B、0<=x<100 C、i=j==0 D、(char)(65+3) 9、在TURBO C中, int类型变量所占字节数是(B )。 A、1 B、2 C、4 D、8 10、C语言中基本的数据类型包括(B)。 A、整型,实型,逻辑型 B、整型,实型,字符型

(完整版)《C语言程序设计》基本知识点

《C语言程序设计》教学基本知识点 第一章C语言基本知识 1.C源程序的框架 尽管各个C源程序的功能千变万化,但框架是不变的,主要有:编译预处理、主函数()、函数n()等,主函数的位置不一定在最前面,可以在程序的中部或后面,主函数的名字固定为main。 2.C语言源程序的书写规则: (1)C源程序是由一个主函数和若干个其它函数组成的。 (2)函数名后必须有小括号,函数体放在大括号内。 (3)C程序必须用小写字母书写。 (4)每句的末尾加分号。 (5)可以一行多句。 (6)可以一句多行。 (7)可以在程序的任何位置加注释。 3.语句种类 语句是程序的基本成分,程序的执行就是通过一条条语句的执行而得以实现的,根据表现形式及功能的不同,C语言的基本语句可以分为五大类。 (1)流程控制语句 流程控制语句的功能是控制程序的走向,程序的流程有三种基本结构:顺序结构、分支结构和循环结构,任何复杂的程序都可以由这三种基本结构复合而成。其中后两种结构要用特定的流程控制语句实现。 (2)表达式语句 表达式语句的形式是:表达式;,即表达式后跟一分号“;”,分号是语句结束符,是一个语句必不可少的成分。表达式和表达式语句的区别在于表达式代表的是一个数值,而表达式语句则代表一种动作。最常见的表达式语句是赋值语句。 (3)函数调用语句 函数调用语句实际上也是一种表达式语句,形式为:在一次函数调用的小括号后面加上一个分号。 (4)空语句 空语句的形式就是一个分号,它不代表任何动作,常常作为一个意义转折点使用。 (5)复合语句 复合语句从形式上看是多个语句的组合,但在语法意义上它只相当于一个语句,在任何单一语句存在的地方都可以是复合语句。注意复合语句中最后一个语句末尾的分号不能少。复合语句右大括号后面没有分号。 4.运算符 用来表示数据各种操作的符号称为运算符。运算符实际上代表了一种类型数据的运算规则。不同的运算符具有不同的运算规则,其操作的数据类型必须符合该运算符的要求,运算结果的数据类型也是固定的。 根据参加操作的数据个数多少,可以将C语言的运算符分为单目运算符,双目运算符和三目运算符(三目运算符只有条件运算符一个)。 根据运算对象和运算结果的数据类型可分为算术运算符、关系运算符、逻辑运算符等。 5.表达式 表达式是由常量、变量、函数,通过运算符连接起来而形成的一个算式。一个常量,一个变量或一个函数都可以看成是一个表达式。 表达式的种类有: 算术表达式、关系表达式、逻辑表达式、赋值表达式、字位表达式、强制类型转换表达式、逗号

C语言程序设计第二版习题参考答案

C语言程序设计第二版 习题参考答案 Document serial number【LGGKGB-LGG98YT-LGGT8CB-LGUT-

C语言程序设计习题参考答案 习题 1 一、判断题 1.在计算机中,小数点和正负号都有专用部件来保存和表示。 2.二进制是由0和1两个数字组成的进制方式。 3.二进制数的逻辑运算是按位进行的,位与位之间没有进位和借位的关系。 4.在整数的二进制表示方法中,0的原码、反码都有两种形式。 5.有符号数有三种表示法:原码、反码和补码。 6.常用字符的ASCII码值从小到大的排列规律是:空格、阿拉伯数字、大写英文字母、小写英文字母。 解:1.F2.T 3.T 4.T 5.T 6.T 二、单选题 1.在计算机中,最适合进行数值加减运算的数值编码是。 A. 原码 B. 反码 C. 补码 D. 移码 2.已知英文小写字母m的ASCII码为十进制数109,则英文小写字母y的ASCII 码为十进制数。 A. 112 B. 120 C. 121 D. 122 3.关于ASCII码,在计算机中的表示方法准确地描述是。 A. 使用8位二进制数,最右边一位为1 B. 使用8位二进制数,最左边一位为1 C. 使用8位二进制数,最右边一位为0 D. 使用8位二进制数,最左边一位为0 4.设在机器字长4位,X=0111B,Y=1011B,则下列逻辑运算中,正确的是 ___________。 A. X∧Y=1000 B. X∨Y=1111 C. X⊕Y=0011 D. ˉY=1000 5.下列叙述中正确的是()。 A.高级语言就是机器语言 B.汇编语言程序、高级语言程序都是计算机程序,但只有机器语言程序才是计算机可以直接识别并执行的程序 C.C语言因为具有汇编语言的一些特性,所以是汇编语言的一种 D.C源程序经过编译、连接,若正确,执行后就能得到正确的运行结果6.用C语言编写的源程序经过编译后,若没有产生编译错误,则系统将()。 A.生成可执行文件B.生成目标文件 C.输出运行结果D.自动保存源文件 7.下列叙述中不正确的是()。 A.main函数在C程序中必须有且只有一个 B. C程序的执行从main函数开始,所以main函数必须放在程序最前面 C. 函数可以带参数,也可以不带参数。

程序设计基础期末考试题A卷

《程序设计基础》试题 程序设计基础期末考试题A 卷 一、 选择题(1*20=20分) 题号 1 2 3 4 5 6 7 8 9 10 总分 答案 题号 11 12 13 14 15 16 17 18 19 20 答案 1、一个完整的计算机系统应该包括( ) A 、系统软件和应用软件 B 、计算机及其外部设备 C 、硬件系统和软件系统 D 、系统硬件和系统软件 2、“裸机”的概念是指( ) A 、正在进行设计还没有组装好的计算机 B 、已经组装好但还没有安装任何软件的计算机 C 、仅安装了操作系统的计算机系统 D 、安装了文字处理软件但没有安装专用数据处理系统的计算机 3、世界上第一台电子数字计算机研制成功的时间是( ) A 、1936年 B 、1946年 C 、1956年 D 、1970年 4、CASE 的含义是( ) A 、计算机辅助设计 B 、计算机辅助制造 C 、计算机辅助教学 D 、计算机辅助软件工程 5、当前广泛使用的微型计算机是( ) A 、第一代 B 、第二代 C 、第三代 D 、第四代 6、当代计算机的体系结构称为是( ) A 、冯·诺依曼机 B 、非冯·诺依曼机 C 、图灵机 D 、比尔盖茨机 7、硬盘是( ) A 、输入设备 B 、输出设备 C 、存储设备 D 、计算设备 8、下面4句话中,最准确的表述是( ) A 、程序=算法+数据结构 B 、程序是使用编程语言实现算法 C 、程序的开发方法决定算法设计 D 、算法是程序设计中最关键的因素 9、计算机能直接执行的语言是( ) A 、机器语言 B 、汇编语言 C 、高级语言 D 、目标语言 10、解释程序的功能是( ) A 、将高级语言程序转换为目标程序 B 、将汇编语言程序转换为目标程序 C 、解释执行高级语言程序 D 、解释执行汇编语言程序 11、下面4种程序设计语言中,不是面向对象式语言的是( ) A 、JAVA B 、Object Pascal C 、Delphi D 、C 12、不是C 语言的基本数据类型是( ) A 、int B 、double C 、char D 、bool 13、在C 语言中,为了求两个整数相除之后得到的余数,可以使用运算符( ) A 、/ B 、% C 、* D 、++ 14、数据的逻辑结构分为( ) A 、纯属结构和非线性结构 B 、顺序结构和非顺序结构 C 、树型结构和图型结构 D 、链式结构和顺序结构 班级 姓名

C语言程序设计基础

题型及分数: 单选题:25分 判断题:10分 填空题:15分 程序分析题:20分 编程题:30分 其中:课后习题及复习大纲中相类似题所占比例在70%-80%。 带*号的内容和复习题为较难部分,为非重点考察内容。 第一章C语言程序设计基础(出题比例4-6%) 1.程序设计语言的基本概念 ?程序 ?程序设计语言 ?常用程序设计语言及其类型 ?源程序、编译、目标文件、连接、可执行程序 ?编程的步骤 2.C语言程序的基本结构 (1) C源程序的框架 C源程序的框架,主要有:编译预处理、主函数()、函数n()等,主函数的位置不一定在最前面,可以在程序的中部或后面,主函数的名字固定为main。 (2) C语言源程序的书写规则: ?C源程序是由一个主函数和若干个其它函数组成的; ?函数名后必须有小括号,函数体放在大括号内; ?C程序对大、小写字母书写敏感; ?每句的末尾加分号; ?可以一行多句; ?可以一句多行; ?可以在程序的任何位置加注释,注释的方式。 3.C语言程序设计的的基本步骤和调试过程 复习题:/***** 1. 每个C语言程序中有且仅有一个函数,它是程序的入口和出口。 2. 引用C语言标准库函数,一般要用预处理命令将其头文件包含进来。 3. C语言属于() A.高级语言 B. 低级语言 C.中级语言 D. 机器语言 4. C语言规定了若干有特定意义、为C语言专用的单词,称为关键字。 5. C语言的语句以结尾。 6. C语言源程序经过编译以后生成文件,生成的文件名后缀为,经过连接后生成文件,后缀为 7.C语言中不能使用关键字作为标识符。(√)

第二章基本数据类型,运算符与表达式(出题比例20-30%) 关键知识点: 1.常量,变量: a)标识符的命名规则 b)常量,变量的概念:直接常量,符号常量,变量必须先定义后使用 c)变量名和变量值的区别。 2.C语言中的基本数据类型 a)各种数据类型的数据在内存中的存放方式 b)掌握各种数据类型数据的常量使用方法,特别注意字符常量和字符串常量的区别使 用 c)整型,字符型,浮点型变量的定义和引用方法 d)数据的数据类型,数据的取值范围,数据在内存中存放方式三者之间的联系 3.运算符和表达式的使用方法 a)自增、自减运算符 b)赋值运算符 c)算术运算符及表达式 d)逗号运算符及表达式 e)*位运算符及表达式 f)sizeof运算符及表达式 g)*强制数据类型转换符及表达式 4.运算符的优先级和结合性 本章复习题: 课后习题:一、单选题,二、填空题 1. C语言的标识符命名规则中,第一个字符可以为字符‘#’或‘&’ .(×)。 2.下列全部属于合法的用户标识符的是() A.A1 P_0 dS B. float 2la _A C. *a hy kk D. _123 temp main 3. C语言对字母的大小写不敏感。(×) 4. C语言中,符号常量由宏定义命令#define来定义。(√) 5. 在VC 6.0中,数据类型int,char,float和double所占的内存字节数分别是、、和。 6.下列四个选项中,均是合法的整型常量的选项是A A.160 –0XFFFF 011 B。-0XCDF 01A 0XE C.-01 986,012 0688 D。-0X48a 2e5 0x

《C语言程序设计基础》 试卷A及参考答案

《c语言程序设计基础》试卷 (A卷) 考试时间:90分钟闭卷任课老师: 班级:学号:姓名:成绩: (每小题2分,共30分) 、由C++源文件编译生成的目标文件的缺省扩展名为() A、cpp B、exe C、obj D、lik 2、下列中,不是C++合法的标识符() A、2mn B、m123 C、kk D、a_1 3、C++中,基本数据类型不包括() A、int B、float C、char D、class 4、x和y均为bool量,则x| |y为真的条件是() A、它们均为真 B、其中一个为真 C、它们均为假 D、其中一个为 5、C++中,一个字符型数据在内存中占()字节。 A、4 B、2 C、1 D、8 6、字符串常量”hello”的长度是() A、5 B、6 C、7 D、8 7、以下语句,int i=2,j=2,m,n;m=i++;n=++j;则m,n,i,j的值分别为() A、2,3,2,2 B、2,3,3,3 C、2,2,3,3 D、3,3,2,2 8、假定a为一个整型数组名,则元素a[4]的字节地址为()

A、a+4 B、a+8 C、a+16 D、a+32 9、 x>0 || y==5的相反表达式为()。 A、 x<=0 || y!=5 B、 x<=0 && y!=5 C、 x>0 || y!=5 D、 x>0 && y==5 10、在下面的函数声明中,存在着语法错误的是() A、void BC(int a , int) B、void BD(int , int) C、void BE(int , int=5) D、int BF(int x ; int y) 11、循环体至少被执行一次的语句为()。 A、for循环 B、while循环 C、do循环 D、任一种循环 12、已知一函数中有下列变量定义,其中属于静态变量的是() A、int a=5; B、static double b; C、register char c; D、auto short d; 13、do语句能够改写为()语句。 A、复合 B、if C、switch D、 while 14、要使语句: p=new int[10]; 能够正常执行,p应定义为() A、int p; B、int p[10]; C、int *p; D、int (*p)[10]; 15、编写C++程序一般需经过的几个步骤依次是( )。 A、编译、编辑、连接、调试 B、编辑、编译、连接、调试 C、编译、调试、编辑、连接 D、编辑、调试、编辑、连接 二、填空题(每小题1分,共10分) 1、使用const 语句定义一个标识符常量时,则必须对它同时进行。 2、用于输出表达式值的标准输出流对象是_________,用于从键盘上为变量输入

C语言程序设计习题答案

C 语言程序设计习题答案 习题一 C 语言程序设计概述 一、名词解释 (1)程序P1 (2)程序设计P1 (3)机器语言P1 (4)汇编程序P2 (5)高级语言P2 (6)编译程序P3 (7)解释程序P3 (8)算法P4 (9)结构化的程序设计P9 二、简述题 1. 设计程序时应遵循哪些基本原则?P4 答:正确性、可靠性、简明性、有效性、可维护性、可移植性。 2. 算法的要素是什么?算法具有哪些特点? 答:算法的要素是:操作与控制结构;算法的特点有:有穷性、确定性、有效性、有零个或多个输入、有一个或多个输出。 3. 算法的表示形式有哪几种? 答:算法的表示形式有:自然语言、传统流程图、伪代码、结构化的流程图(N_S 流程图,盒图)。 4. 有哪三种基本结构? 答:三种基本结构是:顺序结构、选择结构和循环结构。 5. 传统流程图与N-S 流程图最大的区别是什么? 答:N-S 流程图去掉了在传统流程图中常用的流程线,使得程序的结构显得更加清晰、简单。 三、用传统流程图、N-S 图分别表示求解以下问题的算法。 1. 有3个数a ,b ,c ,要求按由大到小的顺序把它们输出。 2. 依次将10个数输入,求出其中最大的数 和最小的数并输出。 3. 求1+2+3+…+100的值。

5. 求下列分段函数的值。 6. 求100~200之间的所有素数。 7. 求一元二次方程ax 2+bx+c=0的根。分别考虑d=b 2-4ac 大于0、等于0和小于0三种情况。 四、注释下面C 程序的各个组成部分。 main() /*主函数 */ { /*程序开始 */ int a,k,m; /*定义三个用来存放整数的变量 */ a=10; /*将整数10赋值给变量a */ k=2; /*将整数2赋值给变量k */ m=1; /*将整数1赋值给变量1 */ a=(k+m)*k/(k-m); /*先求出算术表达式的值,并将其赋值给变量a */ printf("%d\n",a); /*在屏幕上打印出变量a 的值 */ } /*程序结束 */ 习题二 数据类型、运算符与表达式 一、选择题 1~10:BCDCB DDBCA 11~20: ADDAA DBADC 21~28: DABAD CDD Y= 3X (X<1) 4X-1 (X=1) 5(X-1)+6 (1

相关文档
最新文档