文档库 最新最全的文档下载
当前位置:文档库 › c语言题库(判断)河南工业大学 河工大 c语言期末考试题库(C language question

c语言题库(判断)河南工业大学 河工大 c语言期末考试题库(C language question

c语言题库(判断)河南工业大学 河工大 c语言期末考试题库(C language question
c语言题库(判断)河南工业大学 河工大 c语言期末考试题库(C language question

c语言题库(判断)河南工业大学河工大 c语言期末考试题库(C language question bank (judgment), Henan University of Technology C language final examination questions bank)

~~~1

All the operations of a computer are controlled by the program. Without the program, the computer will accomplish nothing.

~y

~~~1

A program is a set of instructions that a computer can recognize and execute.

~y

~~~1

Since computers can recognize and accept machine instructions directly, machine language is the most suitable language for people to program.

~n

~~~1

A compiler can convert programs written in high-level language into machine instructions.

~~~1

In general, we refer to programs written in high-level languages as object programs.

~n

~~~1

Before you can generate executable programs, you should compile and connect again.

~y

~~~1

The reason for high-level language is that it can be written in a program that does not follow any form.

~n

~~~1

C programming language freedom is large, so it belongs to unstructured language.

~n

~~~1

The C language is a high-level language that does not allow direct access to physical addresses.

~n

~~~1

Functions are a major part of a C program.

~y

~~~3

If you use the TC2.0 compiler, the compilation system is assigned 2, 1, and 4 bytes to int, char, and float

~y

~~~3

The following are valid variable names: day, sum, and _pint

~y

~~~3

If char c is defined, then c= "C"";

~n

~~~3

The C language can use a symbolic name to represent a constant

~y

~~~3

The following procedures segment float x=3.6; int i; i= (int) x; then x=3, i=3

~n

~~~3

In the C language, character data can be arithmetic operations with integer data

~y

~~~3

The accuracy can be specified when using scanf to enter data

~n

~~~3

In C (+, -) operator can only be used for variable

~y

~~~3

The float a=b=c=1.0 is correct in the C language

~n

~~~3

In putchar (c), C can be an escape character

~y

~~~4

The if statement, whether written on a few lines, is a whole and belongs to the same statement.

~y

~~~4

The entire if statement can be written on multiple lines or written on a single line.

~y

~~~4

In the if statement, if must have else.

~~~4

In the if statement, else must have if.

~y

~~~4

The else clause cannot be used alone as a statement, and must be paired with if.

~y

~~~4

In the C language compiling system, when the result of logical operations is expressed, the value "1" stands for "truth", and "0" means "false"".

~y

~~~4

Arithmetic operators have precedence over relational operators.

~y

~~~4

Logic is not the highest priority in logical operators.

~y

~~~4

The switch statement is a multi branch selection statement.

~y

~~~4

In judging whether a quantity is true, 0 represents "false", and "0" stands for "true"".

~y

~~~5

In the C language, 3 statements that implement the loop structure are the for statement, the while statement, and the DO-WHILE statement.

~y

~~~5

For ((.)) and while (1) are infinite loops.

~y

~~~5

In C, the while statements that implement loop structures are exactly equivalent to the DO-WHILE statements.

~n

~~~5

The execution statement for (i=1; i++<4;); the value of the latter variable I is 4

~n

~~~5

The for statement can only be used in cases where the number of cycles has been determined.

~n

~~~5

The existing definition of int k=1; executes the statement while (++k<4); then, the value of K is 4

~y.

~~~5

#include int (main) program j=10, i=0 {int, k=2, s=0; for (;;) {i+=k; if (i>j) {printf (%d, s); break;}s+=i;}}, judge i>j carried out 6.

~y

~~~5

Int s=36; while (s) --s; constitutes a dead loop.

~n

~~~5

Program segment int =0; while (t=1) {printf ("%d\n", "t");} at run time, the printf statement executes 0 times.

~n

~~~5

Program #include, , int, main (), {int, x=23;. Do {printf ("%d", "x--"); "while" ("X");} the output of the runtime is 23

~y

~~~6

When defining an array, an array subscript can be represented by a variable

~n

~~~6

When referencing elements in an array, the array subscript can be represented by a variable

~y

~~~6

Int a[8]; defines an integer array; the last element in the array is a[8]

~n

~~~6

Int a[6]; defines an integer array; the first element in the array is a[1]

~n

~~~6

Int a[2][3]; defines an array in which there are 6 elements in the array

~y

~~~6

Suppose that s[10] is an array of characters, by scanf ("%d", "s"); you can enter a string to the array

~y

~~~6

Int a[6]={0}; defines an array a, and the initial value of each element in the array is 0

~y

~~~6

Int, a[2][3]={{1}, {2}, {3}}; the correct method of initial values for an array

~y

~~~6

Compare the size of two strings, and you can use the strcpy function

~n

~~~6

To connect two strings, you can use the strcat function

~y

~~~6

To test the length of a string, you can use the strlen function

~y

~~~7

If the definition of the call function appears before the main function, you do not have to declare it.

~y

~~~7

The C language cannot define functions nested, nor can nested functions be called. That is to say, no function can be called in the process of invoking a function

~n

~~~7

The variables defined in the primary function are also valid only in the primary function, not in the entire file or program because they are defined in the main function. The main function cannot use variables defined in other functions.

~~~7

Variables in different functions can use the same name. They represent different objects and do not interfere with each other.

~y

~~~7

Within a function, variables can be defined in compound statements, which are valid only in the compound statement, which is also called a sub program or a block of programs".

~y

~~~7

The variables defined in a function are external variables, and variables defined outside the function are called local variables, and the external variables are global variables (also known as whole variables).

~n

~~~7

Local variables can be shared by other functions in this document. Its range of validity starts from the location of the

defined variable to the end of the source file.

~n

~~~7

It can be divided into static storage mode and dynamic storage mode from the point of view of the existence of variable value.

~y

~~~7

The so-called dynamic storage means when the program is running, the system allocates a fixed storage space.

~n

~~~7

Static storage is the way to dynamically allocate storage space as needed during program execution.

~n

~~~7

In C, if a pointer variable is used to call an argument, the pointer variable is determined, pointing to a defined cell.

~y

~~~7

In the C language, the call of a function can only get a return value, and the pointer can be used as a function parameter to obtain multiple values.

~y

~~~7

In C language, input and output statements are used to input and output data.

~n

~~~7

When using the putchar function, you must include the header file stdio.h before.

~y

~~~7

Using the putchar function, you can output a string to the terminal.

~n

~~~7

Using the printf function, you can output by a certain number of digits.

~y

~~~7

In the printf function, both%c and%s can output strings.

~n

~~~7

When you enter data into a defined variable with the scanf function, you must add &.

~y

~~~7

When data is entered into a defined variable using the scanf function, the data input ends when an illegal input is entered.

~y

~~~7

The use of input and output functions, putchar (getchar ()), statements are wrong (correct).

~~~8

The pointer to the array element is the address of the index group element.

~y

~~~8

The program for exchanging two pointer variables P1 and P2 is temp=*p1; *p1=*p2; *p2=temp;

~n

~~~8

Printf ("%d", "a[i]") plays the same role as printf ("%d", "*" (a+i)), and the former is efficient.

~n

~~~8

The array name of the parameter is not a national address, but is handled by pointer variables.

~y

~~~8

The pointer to the function that defines the format is int *p (int, int);.

~n

~~~8

The program segments int, *p, a=2; p=&a; printf ("%d", * (p++)); the output is 2

~y.

~~~8

In C99, you can define pointer variables of the base type of void, which can point to any type of variable.

~n

~~~8

The program segment that points P to the string "China" is char *p; p= "China"";

~y

~~~8

Program segments are int, a, m=4, n=6, *p1=&m, *p2=&n, a= (*p1) / (*p2) +5; after execution, the value of a is 5

~y

~~~8

Void f (int *n) {while ((*n) - (printf); "%d" + + (*n));} (main) {int a=1; f (&a);} no output

~n

~~~9

The C language allows users to build their own composite data structures composed of different types of data, called structures.

~y

~~~9

The name of the struct type is the name of the struct.

~n

~~~9

When defining a struct, the type of a member must be specified, either as a simple data type or as a constructed data type.

~y

If the program contains the struct type, the name of the struct member cannot be the same as the variable name in the program.

~n

~~~9

Members of structural variables can perform various operations just like normal variables.

~y

~~~9

Each element of an array in an array of structures is of the same type, and can perform input and output operations on each array element as a whole.

~n

~~~10

The file identifier contains three parts,

File path, file name, trunk, and file suffix. The naming rule of a file name follows the naming rule of an identifier. The suffix is used to represent the nature of a file, consisting of 3 letters.

C语言期末考试题(含答案)

《C 语言程序设计》期末试卷 一、单项选择题(10x2’=20’) 1、以下叙述正确的是() A )C 语言的源程序不必通过编译就可以直接运行。 B ) C 语言中的每条可执行语句最终都将被转换成二进制的机器指令。 C )C 语言源程序经编译形成的二进制代码可以直接运行。 D )C 语言中的函数不可以单独进行编译。 2、一个C 语言的源程序中() A )必须有一个主函数 B )可能有多个主函数 C )必须有除主函数外其它函数 D )可以没有主函数 3、以下不能定义为用户标识符的是() A )scanf B )Void C )_3com D )int 4、若以下选项中的变量已正确定义,则正确的赋值语句是() A )x1=26.8%3; B )1+2=x2; C )x3=0x12; D )x4=1+2=3; 5、设有定义:floata=2,b=4,h=3;以下C 语言表达式中与代数式h b a *)(2 1 的计算结果不.相符的是() A )(a+b)*h/2 B )(1/2)*(a+b)*h C )(a+b)*h*1/2 D )h/2*(a+b) 6、C 语言中用于结构化程序设计的3种基本结构是() A )顺序结构、选择结构、循环结构 B )if 、switch 、break C )for 、while 、do-while D )if 、for 、continue 7.在while (!x )语句中的!x 与下面条件表达式等价的是() A)x!=0B)x==1C)x!=1D)x==0

8、有以下程序: #include voidmain(){ inti=1,j=1,k=2; if((j++||k++)&&i++) printf(“%d,%d,%d\n”,i,j,k);} 执行后的输出结果是() A)1,1,2 B)2,2,1 C)2,2,2 D)2,2,3 9、有以下程序: #include voidmain(){ inti,s=0; for(i=1;i<10;i+=2) s+=i+1; printf(“%d\n”,s);} 程序执行后的输出结果是() A)自然数1~9的累加和B)自然数1~10的累加和 C)自然数1~9中奇数之和D)自然数1~10中偶数之和 10、有以下函数定义: voidfun(intn,doublex){……} 若以下选项中的变量都已经正确定义并赋值,则对函数fun的正确调用语句是()A)fun(inty,doublem); B)k=fun(10,12.5); C)fun(x,n);D)voidfun(n,x); 二、填空题(10x2’=20’) 11、C语言描述“x和y都大于或等于z”的表达式是:。 12、函数定义时涉及的基本要素是:、、。

北京理工大学网络教室C语言编程题库及答案(绝对经典)

北京理工大学网络教室C语言编程题库及答案(绝对经典)

1.Hello world. 输入:无 输出:Hello world. 程序: #include int main() { printf("Hello world.\n"); return 0; } 2.Welcome to Beijing. 程序: #include int main() { printf("Welcome\n"); printf("to\n"); printf("Beijing.\n"); return 0; } 3. 求A+B 输入:整数1 整数2

输出:整数1+整数2=和 程序: #include int main() { int a,b; scanf("%d",&a); scanf("%d",&b); printf("%d+%d=%d\n",a,b,a+b); return 0; } 4. 求 x 的 3次方 输入:一个整数。 输出:该整数的 3 次方值。 程序: #include int main() { int x; scanf("%d",&x); printf("%d\n",x*x*x); return 0; } 5. 学习打印你的第一个图形

编写一个小程序,要求输出的是 4 行由*号组成的等腰三角形。 程序: #include int main() { printf(" *\n"); printf(" ***\n"); printf(" *****\n"); printf("*******\n"); return 0; } 6. 一年级的算术题 输入:接受两个整数,每个整数之间使用空格分隔。例如输入格式为:123 444 输出:分别输出按照整型数据进行 +、-、*、/、* 之后的运行结果。 程序: #include int main() { int a,b; scanf("%d %d",&a,&b); printf("%d+%d=%d\n",a,b,a+b); printf("%d-%d=%d\n",a,b,a-b);

河南工业大学通信原理试卷

2008 至 2009 学年第 1 学期 通信原理试卷A 卷 一、 单项选择题(每小题3分,共21分) D A B C D B C 1. 以下方法中,( D )不能作为增大视距传播的距离的方法。 A.中继通信 B. 卫星通信 C.平流层通信 D.地波通信 2. 在光纤中,( A )。 A. 纤芯的折射率大于包层的折射率 B. 纤芯的折射率小于包层的折射率 C .纤芯的折射率等于包层的折射率 D. 不能确定纤芯和包层的折射率哪个大 3. 提出部分响应系统的目的是为了提高频带利用率,并( B )。 A. 消除码间干扰 B. 加速传输波形的尾巴衰减 C .降低噪声的影响 D. 使得传输波形的频谱变成理想 低通特性 4.高斯白噪声通过窄带理想带通滤波器后为窄带高斯噪声,后者包络的一维分布为(C )。 A. 高斯分布 B. 莱斯分布 C. 瑞利分布 D. 均匀分布。 5. 在AM 、DSB 、SSB 、VSB 等4个通信系统中,有效性最好的通信系统是( D )。 A. AM B. VSB C. DSB D. SSB 密 封 线 内 不 要 答 题 ┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃ 密 ┃┃┃┃┃┃┃┃┃┃┃ 封 ┃┃┃┃┃┃┃┃┃┃┃ 线 ┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃

6. 设基带信号为()f t ,载波角频率为c ω,?()f t 为()f t 的希尔伯特变换, 则DSB 信号的一般表示式为( B )。 A. 0()[()]cos c s t A f t t ω=+ B. ()()cos c s t f t t ω= C. 12?()[()cos ()sin ]c c s t f t t f t t ωω=- D.12?()[()cos ()sin ] c c s t f t t f t t ωω=+。 7.2DPSK 中,若采用差分编码加2PSK 绝对相移键控的方法进行调制, a n 为绝对码, b n 为相对码,则解调端码型反变换应该是( C ): A. B. C. D. 二、填空题(每小题2分,共20分) 1.对于AM 系统,无门限效应的解调方法是___相干解调_________。 2.已知FM 波的表达式63()10cos(21010sin(10))s t t t ππ=?+(V),可求出载波频率为__106 Hz ___ ,已调波的卡森带宽为_11_kHz ,单位电阻上已调波的功率为_50_W 。 3. 在传输数字信号时,如果时域上波形畸变可引起相邻码元波形之 间发生部分重叠,造成 码间干扰 。 4. 多径传播会引起 频率选择性 衰落 5. 带宽为 6.5MHz 的某高斯信道,若信道中的信号功率与噪声功率谱密度之比为 45.5MHz ,则其信道容量为 ()s MBit C /5.195.6/5.451log 105.626=+?=。 6. 双极性基带信号,当满足 等概 条件时,其功率谱无离散谱分量。 7. 2DPSK,2ASK,2PSK,和2FSK,采用相干解调时,抗信道加性高斯白 n n n b a b ⊕=-11 -⊕=n n n b a b 1 -⊕=n n n b b a 11--⊕=n n n b b a

河工大测量仪器仪表试卷答案-李金文 (1)

河北工业大学函授生考试试卷 课程 测量仪器仪表 教师 李金文 15 / 16学年 第 一 学期 班级 姓名____________ 成 绩_ ______ 1.(15分)热电阻测温时采用何种测量电路?为什么要采用这种电路?说明这种电路的工作原理。 答:通常采用三导线四分之一电桥电路,如图所示 由于采用这种电路,热电阻的两根引线的电阻值被分配在两个相邻的桥臂中,如果R1’=R2’,则由环境温度变化引起的引线电阻值变化所造成的误差被相互抵消。 2.(10分)为什么模拟式差压变送器调校时,应反复调整零点和满度? 答:因为模拟式差压变送器在调整量程时,会影响变送器的调零信号,而在调零时,对满度输出也会有影响。因此,在仪表调校时,应反复调整零点和满度。 3.(10分)请说明EJA 智能压力变送器耐压测试的操作步骤。 答:(1)将接线盒内(SUPPL Y )电源“+”与“-”用导线短接。 (2)关闭耐压测试仪的电源,测试仪的一端与SUPPL Y 的短接端联接,另一端与接地端联接,确认测试仪的接地端与地相联接。 (3)开启耐压测试仪电源,漏电流为10mA ,测试电压从0V 逐渐增加到规定耐压值。 (4)当达到规定耐压值时,保持一分钟。 (5)测试完毕后,将电压逐渐降低到0V 以防止浪涌电压。 4.(10分)下图为三阀组示意图,请说明差压变送器投入运行和退出运行时的操作步骤。 答:差压变送器使用注意问题:开启表时, 应先打开平衡阀2,再开高低截止阀1、3,当阀1、3全开后,再关阀2。停表时,应先打开平衡阀2,再关闭阀1、3。 4

5.(10分)要测量95V 左右的电压,实验室有0.5级0--300V 量程和1级0~100V 量程的两台电压表供选用,为能使测量尽可能准确,应选用哪一个。 解:用0.5级0--300V 量程的电压表测量95V 电压,最大绝对误差为 V 5.1%)5.0(300±=±?=?=?m m m A γ 最大相对误差为 γx A ?= ==±95 5.1%57.1± 用1级0~100V 量程的电压表测量95V 电压,最大绝对误差为 V 1%)0.1(100±=±?=?=?m m m A γ 最大相对误差为 γx A ?= ==±95 1%05.1± 6.(15分)某直流电路,电压为120V ,电流为3.8A ,现用一功率表测量其功率,如果功率表选用电流量限为5A ,电压量限为150V ,电流线圈内阻为0.135?,,电压线圈内阻为5000?,试计算电压线圈接前或电压线圈接后时由功率表表耗功率引起的相对误差。 解:电压为120V ,电流为3.8A 可求得负载电阻为31.57 ?,,功率为456W 。 若电压线圈接前功率表测出功率 W R I P P W A w 9.45794.1456135.08.345622=+=?+=+= 测出功率与负载电阻实际消耗功率相比的相对误差为 %41.0456 456 9.457=-= γ 若电压线圈接后功率表测出功率 W R U P P WV w 68.46568.94565000 2204562 2=+=+=+= 测出功率与负载电阻实际消耗功率相比的相对误差为 %1.2456 456 68.465=-= γ 负载电阻为电流线圈内阻的229倍,电压线圈内阻负载电阻的161倍,取电压线圈接前的误差小。

C语言期末考试题(含答案)

《C 语言程序设计》期末试卷 一、单项选择题 (10x2’=20’) 1、以下叙述正确的是( ) A )C 语言的源程序不必通过编译就可以直接运行。 B ) C 语言中的每条可执行语句最终都将被转换成二进制的机器指令。 C )C 语言源程序经编译形成的二进制代码可以直接运行。 D )C 语言中的函数不可以单独进行编译。 2、一个 C 语言的源程序中( ) A )必须有一个主函数 B )可能有多个主函数 C )必须有除主函数外其它函数 D )可以没有主函数 3、以下不能定义为用户标识符的是( ) A )scanf B ) Void C ) _3com D ) int 4、若以下选项中的变量已正确定义,则正确的赋值语句是( ) A )x1=26.8%3; B )1+2=x2; C )x3=0x12; D ) x4=1+2=3; 5、设有定义: float a=2,b=4,h=3;以下 C 语言表达式中与代数式 1 (a b) * h 的计 2 算结果不 相符的是( ) . A )(a+b)*h/2 B )(1/2)*(a+b)*h C )(a+b)*h*1/2 D )h/2*(a+b) 6、C 语言中用于结构化程序设计的 3 种基本结构是( ) A )顺序结构、选择结构、循环结构 B )if 、switch 、break C )for 、while 、do-while D )if 、for 、continue 7.在 while (!x )语句中的 !x 与下面条件表达式等价的是( ) A) x!=0 B) x==1 C) x!=1 D) x==0 8、有以下程序: #include void main(){ int i=1,j=1,k=2; if( (j++||k++)&&i++ ) printf( “%d,%d,%d\n ”,i,j,k);} 执行后的输出结果是( ) A )1,1,2 B ) 2,2,1 C )2,2,2 D )2,2,3 9、有以下程序: #include void main(){ int i,s=0; for(i=1;i<10;i+=2) s+=i+1; printf( “%d\n ”,s);} 程序执行后的输出结果是( )

考卷一河南工业大学理论力学习题答案级考试试卷

试卷1 一、填空题(共37分) 1(3分)、在平面极坐标系中,i 为径向单位矢,沿径向; j 横向单位矢,垂直 于径向并指向θ增加的方向.速度分量式为: , 加速度分量式为: 。 2(6分).已知一质点的运动方程为:r=e ct ,θ=bt 。求=v , 。 3(3分)、刚体的定轴转动自由度有 个,它是 定点转动自由度有 个,它是 4(3分)、广义力的定义式为 ,求广义力有两种方法,它们是 和 5(3分)、质点的轨道与质点的总机械能有关,当E=0轨道为 E <0轨道为 E >0轨道为 6(3分)、表现重力是 和 的合力。 7(3分)、傅科摆是显示 的重要实验,这是 力的效应。 8(3分)、确定惯量主轴有两种方法:一是 二是 。 9(5分)、一边长为d 、质量为m 的匀质立方体,分别求出该立方体对过顶点的棱边、面对角线和体对角线的转动惯量J p 、J f 和J b 分别为 10(5分)、一半径为r 的匀质圆盘,平躺在粗糙的水平桌面上,绕通过其中心的竖直轴转动,初始时刻圆盘的角速度大小为ω0。已知圆盘与桌面间的摩擦系数为μ,问经过 时间圆盘将停止 转动。 二、简答题(共23分) 1(3分)、在平面极坐标系中,质点运动的微分方程为: =a

2(5分)、有心力的基本特性为 3(5分)、检验下列的力是否为保守力,如是,则求出其势能 4(2分)、画出下列图的瞬心 5(2分)、画出下列图的虚位移 6(6分)、刚体的定点转动可以用欧拉角表示。试用图说明怎样用欧拉角来表示刚体的定点转动。 三、计算题(每题10分) 1.质点由y 2=2px 的正焦弦(p/2,p)以u 出发,求到达正焦弦的另一端时的速率. 已知, a τ=-2ka n . )()()()(;6,1018,2018)(243233k z F j y F i x F F b abxyz F y bx abxz F y bx abyz F a z y x z y x ++==-=-=

现代控制理论实验五、状态反馈控制器设计河南工业大学

河南工业大学《现代控制理论》实验报告 专业: 自动化 班级: F1203 姓名: 蔡申申 学号:201223910625完成日期:2015年1月9日 成绩评定: 一、实验题目: 状态反馈控制器设计 二、实验目的 1. 掌握状态反馈和输出反馈的概念及性质。 2. 掌握利用状态反馈进行极点配置的方法。学会用MATLAB 求解状态反馈矩阵。 3. 掌握状态观测器的设计方法。学会用MATLAB 设计状态观测器。 三、实验过程及结果 1. 已知系统 u x x ??????????+??????????--=111100020003. []x y 3333 .02667.04.0= (1)求解系统的零点、极点和传递函数,并判断系统的能控性和能观测性。 A=[-3 0 0;0 2 0;0 0 -1];B=[1;1;1];C=[0.4 0.266 0.3333]; [z p k]=ss2zp(A,B,C,0) 系统的零极点: z = 1.0017 -1.9997 p = -3 -1 2 k = 0.9993

[num den]=ss2tf(A,B,C,0) num = 0 0.9993 0.9973 -2.0018 den = 1 2 -5 -6 系统的传递函数: G1=tf(num,den) G1 = 0.9993 s^2 + 0.9973 s - 2.002 ----------------------------- s^3 + 2 s^2 - 5 s - 6 Continuous-time transfer function. Uc=ctrb(A,B); rank(Uc) ans = 3 满秩,系统是能控的。 Vo=obsv(A,C); rank(Vo) ans = 3 满秩,系统是能观的。 (2)分别选取K=[0 3 0],K=[1 3 2],K=[0 16 /3 –1/3](实验中只选取其中一个K为例)为状态反馈矩阵,求解闭环系统的零点、极点和传递函数,判断闭环系统的能控性和能观测性。它们是否发生改变?为什么? A=[-3 0 0;0 2 0;0 0 -1];B=[1;1;1];C=[0.4 0.266 0.3333];K=[0 3 0]; [z p k]=ss2zp(A-B*K,B,C,0) z = 1.0017 -1.9997 p = -3 -1 -1 k = 0.9993 [num den]=ss2tf(A-B*K,B,C,0);G2=tf(num,den) G2 =

C语言期末上机考试题及答案

C语言上机考试题—01 1. //#include #include double fun( int n ) { double sum=0,a=1; for(;n>0;n--,a++) sum=sum+1/(a*(a+1)); return sum; } main() { // clrscr(); printf("%f\n", fun(10)); } 2. #include main() { int k,m,s=0,i,b=0; for(k=10000;k<=20000;k++ ) { if(k%10==7) { for(i=2,b=0;i main() { int a; printf("请输入一个需要判 断的年份:\n"); scanf("%d",&a); if(a%4==0&&a%100!=0) printf("是闰年\n"); else if(a%400==0) printf("是闰年 \n"); else printf("不是闰 年\n"); } C语言上机考试题—02 1. //#include #include double fun( int n ) { double sum=0,a=1; for(;n>0;n--,a++) sum=sum+1/(a*(a+1)); return sum; } main() { // clrscr(); printf("%f\n", fun(10)); } 2. #include fun(int n) { int i,j=0; for(i=2;i #include main() { char str[81]; int i,j=0,w=1,s=0; printf("请输入一串字符: \n"); gets(str); for(i=0;i

北京工业大学C语言作业3-分支

1. 计算个人所得税 1.1. 题目要求 输入一个职工的月薪salary,输出应交的个人所得税tax(保留2位小数)。tax = rate *(salary-850) 当 salary <= 850 时,rate = 0; 当 850 < salary <= 1350 时,rate =0.0 5; 当 1350 < salary <= 2850 时,rate = 0.10; 当 2850 < salary <= 5850 时,rate = 0.15; 当 5850 < salary 时,rate = 0.20; 1.2. 测试结果(输入结束回车符用<回车>表示) (1)输入:800<回车> 输出:tax=0.00 (2)输入:4010<回车> 输出:tax=474.00 (3)输入:2850<回车> 输出:tax=200.00 2. 输出水果单价 2.1. 题目要求 以下4种水果的单价分别是3.00元/公斤,2.50元/公斤,4.10元/公斤,10.20元/公斤。 [1] apples [2] pears [3] oranges [4] grapes 输入水果的编号,输出该水果的单价(保留2位小数)。如果输入不正确的编号,显示单价为0。 2.2. 测试结果(输入结束回车符用<回车>表示) (1)输入:3<回车> 输出: [1] apples [2] pears [3] oranges

[4] grapes price=4.10; (2)输入:5<回车> 输出: [1] apples [2] pears [3] oranges [4] grapes price=0.00 3. 输出大小写字母 3.1. 题目要求 输入一个字符,如果它是大写字母,输出相应的小写字母;如果它是小写字母,输出相应的大写字母;否则,原样输出。 3.2. 测试结果(输入结束回车符用<回车>表示) (1)输入:F<回车> 输出:f (2)输入:y<回车> 输出:Y (3)输入:=<回车 输出:= 附加题:(选做) 4. 计算旅途时间 4.1. 题目要求 输入2个整数time1和time2,表示火车的出发时间和到达时间,计算并输出旅途时间。 有效的时间范围是0000到2359,不需要考虑出发时间晚于到达时间的情

北京工业大学c语言练习1

一、读程序写出运行结果: 1.若从键盘输入58,则以下程序段的输出结果是(): int main(void) { int a; scanf(“%d”,&a); if (a>50) printf(“%d”,a); if(a>40) printf(“%d”,a); if(a>30) printf(“%d”,a); return 0; } 2.下列程序运行的输出结果是(): int main(void) { char c=’b’; int k=4; switch(c) { case ‘a’: k=k+1; break; case ‘b’: k=k+2; case ‘c’: k=k+3; } printf(“%d\n”,k); return 0; } 二、编程题 1.键盘输入一个三位整数,输出该数的各位数字 本题要求编写程序,输出一个三位整数的个位数字、十位数字和百位数字的值。输入格式: 输入152。 输出格式: 按照以下格式输出:

2.将x的平方赋值给y 键盘输入x的值,计算x的平方并赋值给y,分别以“y = x ? x”和“x ? x = y”的形式输出x和y的值。 输入格式: 输入一个整数3 输出格式: 按照下列格式输出代入x=3的结果: y = x * x x * x = y 3. 本题目要求计算下列分段函数f(x)的值: 输入格式: 输入在一行中给出实数x。 输出格式: 在一行中按“f(x) = result”的格式输出,其中x与result都保留一位小数。 输入样例1: 输出样例1: 4.为了提倡居民节约用电,某省电力公司执行“阶梯电价”,安装一户一表的居民用户电价分为两个“阶梯”:月用电量50千瓦时(含50千瓦时)以内的,电价为0.53元/千瓦

河南工业大学单片机课程设计电科13级

《单片机课程设计》 题目: 学生***信息显示与查询系统设计 院系名称:信息科学与工程学院专业班级:电科1301 学生姓名: *** 学号: 201316****** 指导教师:王洪群教师职称:讲师 课程设计时间:2016-7-4—2016-7-14 (文档末尾附有proteus电路图附件) shejitu.DSN

电科1301专业课程设计任务书 说明:本表由指导教师填写,由教研室主任审核后下达给选题学生,装订在设计(论文)首页

目录 摘要 ............................................................................................................... 错误!未定义书签。 1.引言 ....................................................................................................... 错误!未定义书签。 1.1.设计意义 (1) 1.2.设计要求 (1) 1.3.设计所需实验要求环境 (2) 2.设计方案 (2) 2.1.总体设计 (2) 2.2.设计论证 (2) 3.硬件设计 (3) 3.1.原器件介绍 (3) 3.2.点阵及其驱动部分 (4) 3.3.模块设计 (4) 3.3.1时钟和复位及显示屏模块 (4) 3.3.2点阵屏驱动模块及点阵屏模块 (4) 3.3.3键盘模块 (4) 4. 软件设计 (5) 4.1. 设计电路原理框图及仿真电路图 (6) 4.2. 程序流程图及程序编程 (6) 4.3. 系统主程序介绍 (6) 5. 仿真下载程序的过程描述及结果分析 (7) 6.设计总结 (7) 7.附录: 源程序 (7) 8.参考文献 (233)

C语言程序设计期末考试试题及答案

C 语言程序设计 试 题 (2008 /2009 学年 第 二 学期) 一. 选择题(满分30分,每题2分) 1.若a 、b 、c 都定义为int 类型且初值为0,则以下不正确的赋值语句是 D 。 A. a=b=c+8; B. a+=y+3; C. c++; D. a+b+c 2. 已知int j ,i=1;执行语句“j=i++;”后,变量i 的值是 B 。 A. 1 B. 2 C. –1 D. -2 3.执行下面程序: #include "stdio.h" void main() { int a=1,b=2,c=3; c=(a+=a+2),(a=b,b+3); printf(“%d,%d,%d ”,a,b,c); } 则输出结果是: A 。 A. 2,2,4 B. 4,2,3 C. 5,5,3 D. 4,2,5 4.若要求在if 后一对圆括号中表示a 不等于0的关系,则能正确表示这一关系的表达式为 D 。 A. a< >0 B. !a C. a=0 D. a 5. for (j=0;j<11;j++);循环结束后,j 的值是 B 。 A. 12 B. 11 C. 10 D. 9 6. C 语言中函数返回值的类型由 D 决定的。 A. return 语句中的表达式类型 B. 调用该函数的主调函数的类型 C. 调用函数时临时决定 D. 定义函数时所指定的函数类型 7. 下列说法中正确的是 B 。 A 在调用用户自定义函数时,必须对其进行声明。 B 函数可以返回一个值,也可以什么值也不返回。 C 说明函数时,必须明确参数的类型和返回值。 D 在程序设计中空函数没有什么作用。 8. 若int i=10;执行下列程序后,变量i 的正确结果是 D 。 switch ( i ) {case 0: i+=1; case 10: i+=1; case 11: i+=1; default: i+=1; } A. 10 B. 11 C. 12 D. 13 9. 下列语句中不正确的字符串赋值或初始化的是 C 。 A . char str[10]={"strings"}; B.char str[8]={'s','t','r','i','n ','g','s','\0'}; C. char str[10]; str= "strings"; D. char str[]= "strings"; 10. 有如下程序: #include void main() { int a=1,b=0,c=0; if (a

北京工业大学c语言练习7-结构

练习7 结构 学号姓名 一、阅读程序 #include struct student{ int num; char name[10]; int computer, english, math; double average; }; void main(void) { int i, n; struct student s; printf("Input n: "); scanf("%d", &n); printf("Input the student’s number, name and course scores\n"); for(i = 1; i <= n; i++){ scanf("%d%s%d%d%d",&s.num,https://www.wendangku.net/doc/8912493560.html,,&s.math,&s.english,&https://www.wendangku.net/doc/8912493560.html,puter); s.average = (s.math + s.english + https://www.wendangku.net/doc/8912493560.html,puter) / 3.0; printf("num:%d, name:%s, average:%.2lf\n", s.num, https://www.wendangku.net/doc/8912493560.html,, s.average); } } (1)若在程序运行时输入: 1<回车> 20130101 张三 90 95 85<回车> 运行结果是: (2) 简述程序的主要功能: 二、程序填空 1. 该程序的功能是:输入某班学生的姓名及数学、英语成绩,计算每位学生的

平均分;然后输出平均分最高的学生的姓名及数学、英语成绩。 #include struct student{ char name[10]; int math,eng; double ave; }; int main(void ) { int i,n,max=0; struct student s[50]; scanf("%d",&n); for(i=0;i void main() { struct person

河南工业大学15-16-1计算机网络试卷A卷

2015 至 2016 学年 第 1 学期 《计算机网络》 试卷 A 卷 适应年级专业: 2013级计算机科学与技术、2013级软件工程、2013 级空间信息与数字技术 考核方式: 闭卷 班 级: 学 号: 姓 名: 复查总分: 成绩比例:本试卷考试分数占总评成绩的 70 % 一、选择题(共 20 题,每题 1 分,共 20 分,请把答案写入答题框中) 1. 人们将网络层次结构模型和各层协议定义为网络的 。 A )拓扑结构 B )协议集 C )体系结构 D )开放 系统互联模型 2. TCP/IP 参考模型的网络层提供的是 。 A )无连接不可靠的数据报服务 B )无连接可靠的数据报服务 C )有连接不可靠的虚电路服务 D )有连接可靠的虚电路服务 3. 网络协议的核心要素是指 。 A )数据格式、编码、信号表示 B )数据、控制、速率 C )语义、语法、同步 D )地址、端口、复用。 4. IEEE802.3标准的以太网的物理地址长度为 。 A )8bit B )32bit C )48bit D )64bit 5. 以下关于网桥不正确的是 。 A )网桥在数据链路层实现互连 B )网桥根据MA C 地址转发数据帧 C )网桥能够识别一个完整的帧 D )网桥能够实现局域网和广域网的互连 6. IP 服务的3个主要特点是 。 A )不可靠、面向无连接和尽最大努力投递 B )可靠、面向连接和尽 最大努力投递 D )可靠、面向无连接和 的说法不正确的是 。 IPv4地址耗尽的问题 B )IPv6解决IPv4无法 支持无线传输的问题 C )IPv6提供了安全增强功能 D )IPv6地址使用冒号十六进制记法 8. 主机甲向主机乙发送一个(FIN =1,seq =11220)的TCP 报文段,期望与主机乙释放TCP 连接,主机乙收到连接释放报文段后发出确认。则主机乙回复 的正确的TCP 连接释放应答报文段可能是 。 A )(FIN =0,ACK =1,seq =11221,ack =11221) B )(FIN =1,ACK =0,seq =11220,ack =11221) C )(FIN =1,ACK =1,seq =11221,ack =11220) D )(FIN =0,ACK =0,seq =11220,ack =11220) 9. 主机甲与主机乙间建立了一个TCP 连接,主机甲向主机乙发送了两个连续的TCP 段,分别包含300字节和500字节的有效载荷,第一个段的序列号为200,主机乙正确接收两个段后,发送给主机甲TCP 段中的确认序列号是 。 A )500 B )700 C )800 D )1000

最新河南工业大学高频电子线路试卷及参考答案

精品文档 2010 至 2011 学年第 一 学期 高频电子线路 试卷B 卷 出卷教师: 徐晓光 适应班级:电科08级 考试方式:闭卷 本试卷考试分数占学生总评成绩的 70 % 题号 一 二 三 四 五 六 七 八 九 十 总分 核分人 得分 复查总分 总复查人 一、填空题(本题25分,每空1分) 1.LC 正弦波振荡器中,LC 回路的Q 值越大,振荡器的频率稳定性越_________。 2. AM 调幅波的频谱,包括____________、___________和____________三部分。 3.调频波的信号带宽比调幅波更_________,其抗干扰能力也比调幅波更_________。 4.为了获得谐振功率放大器所需的最佳负载电阻,应当使用_________网络。 5.当RC 时间常数过________时,二极管包络检波器会出现惰性失真。 6.石英晶体元件的等效Q 值_______,石英晶体振荡器的突出优点是__________________。 7.在并联型振荡器中,石英晶体被等效为一个_______。 8.谐振功率放大器的三种工作状态为___________、__________、_________。 9.锁相环路(PLL )是由___________、___________和______________组成的负反馈环路。锁相环路误差信号为________差信号。 10.中波调幅广播的载波频率大约在_________至_________之间。 11.有一载频为3MHz 、最大幅度8V 、最小幅度0V 的AM 波,其调制电压为 )(6cos 4.0)(103 V t t v ?=Ω π。则AM 波的带宽为_________,该信号在1Ω电阻上的总功率 为_________W 。 12.能实现模拟乘法运算的电路有_________电路,_________电路,_________电路和模拟乘法器集成电路等。 《高频电子线路》试卷 第1页 (共8页) 二、单项选择题(本题20分,每项1分) 1.小信号调谐放大器由高频放大电路和_______组成。 A )低通滤波器 B )带通滤波器 C )高通滤波器 2.高频功率放大器为了获得高效率,常采用________。 A )A 类放大器 B )乙类放大器 C )AB 类放大器 D )丙类放大器 3.通信系统中,信号需要调制的原因是_______。 A )要发射的信号频率低 B )为了实现信道复用 C )减小发射天线尺寸 D )以上都是4.混频器、AM 波调制电路都是频谱搬移电路。其中,混频器的输入为_______信号、_______信号,输出为_______。AM 波调制电路的输入为_______信号、_______信号,输出为_______。 A )已调波 B )等幅高频正弦波 C )调制信号 5.高频谐振功率放大器的负载谐振电阻Rp 由小变大,则放大器工作状态的变化趋势(其他条件不变)为________。 A )过压→临界→欠压 B )丙类→乙类→甲类 C )甲类→乙类→丙类 D )欠压→临界→过压 6.石英晶体在其两个谐振频率之间,呈现_________。 A )电感性 B )电容性 C )电阻性 7.现代通信电路中广泛使用的频率合成器,能够输出_______的信号。 A )频率稳定性好但频率不可调整 B )频率精度高且频率可调 C )频率可调但频率精度不高 8.有一中频为455kHz 的调幅超外差接收机,当接收频率为800kHz 的电台时,则镜像干扰频率为________,本机振荡器的频率为________。 A )455kHz B )1255kHz C )2055kHz D )1710kHz 9.SSB 表示________, USB 表示________,FM 表示________,LSB 表示________。 A )双边带调幅波 B )调幅波 C )调频波 D )上边带 E )下边带 F )单边带信号 10. 在超外差式接收机中,解决镜像干扰的有效方法是________,解决组合频率干扰的有效方法是_______。 A )采用组合频率少的混频器电路形式 B )提高混频器之前电路的频率选择性 C )选用低噪声器件 《高频电子线路》试卷 第2页 (共8页) 得分 评卷人 得分 评卷人 学院名称 专业班级: 姓名: 学号: 我 密 封 线 内 不 要 答 题 ┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃ 密 ┃┃┃┃┃┃┃┃┃┃┃ 封 ┃┃┃┃┃┃┃┃┃┃┃ 线 ┃┃┃┃┃┃┃┃┃┃┃┃┃┃┃

大学C语言考试题库(答案)

================================================== 题号:1482 执行以下程序段后,输出结果和a的值是()。 int a=10; printf("%d",a++); A、11 和 10 B、11 和 11 C、10 和 11 D、10 和 10 答案: C 题号:2100 已知字符'A'的ASCⅡ代码值是65,字符变量c1的值是'A',c2的值是'D'.执行语句printf("%d,%d",c1,c2-2);后,输出结果是 A、65,66 B、A,B C、65,68 D、A,68 答案: A 题号:5055 相同结构体类型的变量之间,可以()。 A、比较大小 B、地址相同 C、赋值

答案: C 题号:3217 int a[10];合法的数组元素的最小下标值为()。 A、1 B、0 C、10 D、9 答案: B 题号:45 能正确表示逻辑关系:" a≥10或a≤0 "的C语言表达式是 A、a>=0 | a<=10 B、a>=10 or a<=0 C、a>=10 && a<=0 D、a>=10 || a<=0 答案: D 题号:157 main() {int x=1,a=0,b=0; switch (x) { case 0: b++; case 1: a++;

case 2: a++;b++;} printf("a=%d,b=%d",a,b); }该程序的输出结果是( ) A、2,2 B、2,1 C、1,1 D、1,0 答案: B 题号:4784 设变量a是整型,f是实型,i是双精度型,则表达式10+'a'+i*f值的 数据类型为()。 A、不确定 B、double C、int D、float 答案: B 题号:1647 以下程序中,while循环的循环次数是______ main() { int i=0; while(i<10) { if(i<1) continue;

相关文档
相关文档 最新文档