没有合适的资源?快使用搜索试试~ 我知道了~
(完整版)C语言程序设计笔记-知识点及例题.doc
3 下载量 107 浏览量
2022-11-12
19:11:12
上传
评论
收藏 241KB DOC 举报
温馨提示
试读
63页
(完整版)C语言程序设计笔记-知识点及例题.doc
资源推荐
资源详情
资源评论
在高压缸排汽的总管上装有动力控制止回阀,以便在事故情况下切断,防止蒸汽返回到汽轮机,引起汽轮机超速。在高压缸排汽总管的端头有蒸汽冲洗接口,以供在管道安装完毕后进行冲洗,在管道冲洗完成后用堵头堵死。center pin checks and anchoring the inner cylinder. According to While coupling alignment should keep oil out of cavity and locate the rotor axis neck raised are within the prescribed limits, there should be no gaps, Horn, Horn and Horn 0.05mm feeler gauges fit into. Center coupling, condenser water filling and water-filled according to factory requirement. For coupling three supported rotor Center, the mouth under the coupling between the value should be as stipulated in the manufacturer, usually 0.15~0.25mm. In the case of coupling connection, if possible, lifting only one bearing end of the support bearing of the rotor, remove the bearing, fitted with special tiles and special lifting tools, disc rotors, check the journal flutter tile, should generally be less than 0.10MM. When the couplings and rotor comes when there is a conflict, the coupling Centre shall prevail. 6.4.5.2.2 shaft looking for: ... 6.4.5.3. Provisional bolt confirmed the positioning of the rotor size, as well as the coupling between the adjustment shim thickness accuracy, drawings to meet the technical requirements. Plane, cylindrical and clean the coupling bolt holes should be clean and without burrs, scrap iron and grease-free, relative position of the coupling according to the drawing requirements are. Coupling top screws, round distance apart, indicators to monitor movement of the aircraft, its value is allowed to pass the value axis moving, mounted adjustment pads, note pads installation direction guide pin coupling with process end closed. The back wheels slowly tightened, when 2mm or so, with standard white bars where two back wheel bolt hole measurement above and below, confirm two back wheel bolt hole concentricity. Then, the symmetrical horizontal mount two temporary bolts tightened, attention to monitor dial indicator, then install the symmetrical temporary bolts, this time sites slowly moving rotor, in the measured circumference of 8 equal parts back wheel rim rock, each measuring relative changes in value should be less than 0.02mm. 6.4.5.4 coupling reamed and paired bolt reaming die reamer, adjustable reamers, boring mill, in several ways. 6.4.5.4.1 General requirements before reaming or boring,
第一章 程序设计基本概念
1.1 程序和程序设计
程序:连续执行的一条条指令的集合称为“程序”。
1.1.2 程序设计
1.确定数据结 2.确定算法 3.编码 4.在计算机上调试程序 5.整理并写出文档资料
1.2 算法
定义:是指为了解决某个特定的问题而采取的确定且有限的步骤。
1 有穷性 2 确定性 3 可行性 4 有零个或多个输入 5 有一个或多个输出
1.3 结构化程序设计和模块化结构
结构化程序由三种基本结构组成
1 顺序结构 2 选择结构 3 循环结构
12)计算机能直接执行的程序是(B )。
A)源程序 B)目标程序 C)汇编程序 D)可执行程序
13)以下叙述中正确的是( D )
A)程序设计的任务就是编写程序代码并上机调试
B)程序设计的任务就是确定所用数据结构
C)程序设计的任务就是确定所用算法
D)以上三种说法都不完整
第二章 :C 程序设计的初步知识
(11)以下叙述中正确的是( C )。
A)C 程序的基本组成单位是语句 B)C 程序中的每一行只能写一条语句
二级 C 语言程序设计试卷)
C)简单 C 语句必须以分号结束 D)C 语句必须在一行内写完
(11)以下叙述中正确的是( C )
A)C 程序中的注释只能出现在程序的开始位置和语句的后面
B)C 程序书写格式严格,要求一行内只能写一个语句
C)C 程序书写格式自由,一个语句可以写在多行上
D)用 C 语言编写的程序只能放在一个程序文件中
第二课:C 语言的基础知识
2.2 标识符,常量和变量
2.2.1 标识符:
定义:由字母,数字和下划线组成,并且第一个字符必须为字母或下划线的。这样的
组成就是标识符。
注意:在 C 中大写字母与小字字母被认为是两个不同的字符。
分类:
关键字:在 C 中已经定义好了的,不能用作它用的。如 if double int 等等。
预定义标识符:如 printf scanf
用户标识符:用户根据自己的需求来定义的。
在高压缸排汽的总管上装有动力控制止回阀,以便在事故情况下切断,防止蒸汽返回到汽轮机,引起汽轮机超速。在高压缸排汽总管的端头有蒸汽冲洗接口,以供在管道安装完毕后进行冲洗,在管道冲洗完成后用堵头堵死。center pin checks and anchoring the inner cylinder. According to While coupling alignment should keep oil out of cavity and locate the rotor axis neck raised are within the prescribed limits, there should be no gaps, Horn, Horn and Horn 0.05mm feeler gauges fit into. Center coupling, condenser water filling and water-filled according to factory requirement. For coupling three supported rotor Center, the mouth under the coupling between the value should be as stipulated in the manufacturer, usually 0.15~0.25mm. In the case of coupling connection, if possible, lifting only one bearing end of the support bearing of the rotor, remove the bearing, fitted with special tiles and special lifting tools, disc rotors, check the journal flutter tile, should generally be less than 0.10MM. When the couplings and rotor comes when there is a conflict, the coupling Centre shall prevail. 6.4.5.2.2 shaft looking for: ... 6.4.5.3. Provisional bolt confirmed the positioning of the rotor size, as well as the coupling between the adjustment shim thickness accuracy, drawings to meet the technical requirements. Plane, cylindrical and clean the coupling bolt holes should be clean and without burrs, scrap iron and grease-free, relative position of the coupling according to the drawing requirements are. Coupling top screws, round distance apart, indicators to monitor movement of the aircraft, its value is allowed to pass the value axis moving, mounted adjustment pads, note pads installation direction guide pin coupling with process end closed. The back wheels slowly tightened, when 2mm or so, with standard white bars where two back wheel bolt hole measurement above and below, confirm two back wheel bolt hole concentricity. Then, the symmetrical horizontal mount two temporary bolts tightened, attention to monitor dial indicator, then install the symmetrical temporary bolts, this time sites slowly moving rotor, in the measured circumference of 8 equal parts back wheel rim rock, each measuring relative changes in value should be less than 0.02mm. 6.4.5.4 coupling reamed and paired bolt reaming die reamer, adjustable reamers, boring mill, in several ways. 6.4.5.4.1 General requirements before reaming or boring,
(12)以下选项中,能用作用户标识符的是( C )
A)void B)8_8 C)_0_ D)unsigned
(11)以下选项中合法的标识符是( C )
A) 1-1 B)1—1 C)-11 D)1—
(12)以下选项中不合法的标识符是 ( C )
A)print B)FOR C)&a D)_00
2.2.2 常量:
定义:是指在程序的执行的过程中,其值不会被改变的量。
分类:
整型常量:没有小数的常量
如:3 9 1234 等等都是。
实型常量:有小数点的常量
如:3.9 3.0 3.
字符常量:由单个字符组成的量
如:’a’ ‘b’ ‘3’
字符串常量:至少由一个字符组成的量
如:“a” “abc” “ beijing”
符号常量:符号常量的值到底是多少,这是由在来定义符号常量时来决定
的
(13)以下选项中,能用作数据常量的是 ( D )
A)o115 B) 0118 C)1.5e1.5 D) 115L
(13)以下选项中不能作为 C 语言合法常量的是( A )。
A)'cd' B)0.1e+6 C)"\a" D)'\011'
(13)以下选项中不属于字符常量的是 ( B )
A)'C' B)"C" C)'\xCC0' D)'\072'
2.3 整型常量与实型常量
整型常量的几个表示方法
十进制数:
八进制数:以 0 开头的数字,由 0-7 组成。
下列合法的八进制数是
A,0 B,028 C,-077 D,01.0
十六进制数:以 0X 开头,由 0-9 和 A-F 组成。
A,oxff B,0xabc C,0x11 D,0x19
实型常量 123.4
小数形式:123.4
指数形式:1.234e2
1. 字母 e 和 E 之前必须要有数字
2.字母 e 和 E 之后的数字必须是整数
3.字母 e’和数字之间不能有空格。
A,2.607E-1 0.8103E 2 -77.77 456E-2 0.1e+6 1.23E1.2
在高压缸排汽的总管上装有动力控制止回阀,以便在事故情况下切断,防止蒸汽返回到汽轮机,引起汽轮机超速。在高压缸排汽总管的端头有蒸汽冲洗接口,以供在管道安装完毕后进行冲洗,在管道冲洗完成后用堵头堵死。center pin checks and anchoring the inner cylinder. According to While coupling alignment should keep oil out of cavity and locate the rotor axis neck raised are within the prescribed limits, there should be no gaps, Horn, Horn and Horn 0.05mm feeler gauges fit into. Center coupling, condenser water filling and water-filled according to factory requirement. For coupling three supported rotor Center, the mouth under the coupling between the value should be as stipulated in the manufacturer, usually 0.15~0.25mm. In the case of coupling connection, if possible, lifting only one bearing end of the support bearing of the rotor, remove the bearing, fitted with special tiles and special lifting tools, disc rotors, check the journal flutter tile, should generally be less than 0.10MM. When the couplings and rotor comes when there is a conflict, the coupling Centre shall prevail. 6.4.5.2.2 shaft looking for: ... 6.4.5.3. Provisional bolt confirmed the positioning of the rotor size, as well as the coupling between the adjustment shim thickness accuracy, drawings to meet the technical requirements. Plane, cylindrical and clean the coupling bolt holes should be clean and without burrs, scrap iron and grease-free, relative position of the coupling according to the drawing requirements are. Coupling top screws, round distance apart, indicators to monitor movement of the aircraft, its value is allowed to pass the value axis moving, mounted adjustment pads, note pads installation direction guide pin coupling with process end closed. The back wheels slowly tightened, when 2mm or so, with standard white bars where two back wheel bolt hole measurement above and below, confirm two back wheel bolt hole concentricity. Then, the symmetrical horizontal mount two temporary bolts tightened, attention to monitor dial indicator, then install the symmetrical temporary bolts, this time sites slowly moving rotor, in the measured circumference of 8 equal parts back wheel rim rock, each measuring relative changes in value should be less than 0.02mm. 6.4.5.4 coupling reamed and paired bolt reaming die reamer, adjustable reamers, boring mill, in several ways. 6.4.5.4.1 General requirements before reaming or boring,
2.2.4 变量:
1.定义:在程序的运行过程中其值可以被改变的量,就叫变量。
2.原则:变量必须先定义后使用。变量定义的过程就是给变量开辟存储单元的过程。
3.分类:
整型变量:用关键字 int 来表示.
short int 短整型
long int 长整型 在内存中占 4 个字节 如 123L
unsigned 无符号 如有-200U 这就是错的。
变量的定义:int a 这是定义了一个整型变量 a.
实型变量:用关键字 double 或 float 来表示。
float 单精度 在内存中占 4 个字节
double 双精度 在内存中占 8 个字节。
2.2.5 算术表达式
一、基本的算术运算符
+ - * / % 这些是双目运算符(就是指操作对象有两个)
注意:
除%外,其它的运算符的运算对象可以是整型也可以是实型。%的操作对象只
能是整型。
如 10%3=1 10.7%3 10%4.5 x%3=0
+ - 也可以做为单目运算。-5.4 +4.9
说明:
1.如果双目运算符两边运算数的类型一致,则所得结果的类型与运算数的类型一
致。如 1.0/2.0=0.5 1/2=0
2.如果双目运算符两边运算数的类型不一致,则系统会自动进行类型转换,使两边
的类型一致后,再进行运算。
1.0/2=0.5
3.所有的单精度数据,在运算过程中都以双精度进行运算。
二、优先级
() + - * / % + -
由高——————低
如 (5+1)/2=???
2.5.3 强制类型转换表达式
格式:(类型名) (表达式)
例:(int)3.234=3
(double)10%3=?
(14)表达式:4-(9)%2 的值是( B )
A)0 B)3 C)4 D)5
(14)设变量已正确定义并赋值,以下正确的表达式是 ( C )
A)x=y*5=x+z B)int(15.8%5) C)x=y+z+5,++y D)x=25%5.0
2.6 赋值表达式
格式:变量名=表达式
注:1.不可以颠倒(左边必须是变量名,右边必须是 C 语言中合法的表达式)
在高压缸排汽的总管上装有动力控制止回阀,以便在事故情况下切断,防止蒸汽返回到汽轮机,引起汽轮机超速。在高压缸排汽总管的端头有蒸汽冲洗接口,以供在管道安装完毕后进行冲洗,在管道冲洗完成后用堵头堵死。center pin checks and anchoring the inner cylinder. According to While coupling alignment should keep oil out of cavity and locate the rotor axis neck raised are within the prescribed limits, there should be no gaps, Horn, Horn and Horn 0.05mm feeler gauges fit into. Center coupling, condenser water filling and water-filled according to factory requirement. For coupling three supported rotor Center, the mouth under the coupling between the value should be as stipulated in the manufacturer, usually 0.15~0.25mm. In the case of coupling connection, if possible, lifting only one bearing end of the support bearing of the rotor, remove the bearing, fitted with special tiles and special lifting tools, disc rotors, check the journal flutter tile, should generally be less than 0.10MM. When the couplings and rotor comes when there is a conflict, the coupling Centre shall prevail. 6.4.5.2.2 shaft looking for: ... 6.4.5.3. Provisional bolt confirmed the positioning of the rotor size, as well as the coupling between the adjustment shim thickness accuracy, drawings to meet the technical requirements. Plane, cylindrical and clean the coupling bolt holes should be clean and without burrs, scrap iron and grease-free, relative position of the coupling according to the drawing requirements are. Coupling top screws, round distance apart, indicators to monitor movement of the aircraft, its value is allowed to pass the value axis moving, mounted adjustment pads, note pads installation direction guide pin coupling with process end closed. The back wheels slowly tightened, when 2mm or so, with standard white bars where two back wheel bolt hole measurement above and below, confirm two back wheel bolt hole concentricity. Then, the symmetrical horizontal mount two temporary bolts tightened, attention to monitor dial indicator, then install the symmetrical temporary bolts, this time sites slowly moving rotor, in the measured circumference of 8 equal parts back wheel rim rock, each measuring relative changes in value should be less than 0.02mm. 6.4.5.4 coupling reamed and paired bolt reaming die reamer, adjustable reamers, boring mill, in several ways. 6.4.5.4.1 General requirements before reaming or boring,
2.功能就是先求出右边表达式的值,然后把此值赋值给赋值号左边的变量。确切
的说是把数据存入以该变量为标识的存储单元中去。a=4 , a=7
3.结合性的优先级仅高于逗号表达式。顺序是自右向左的。如 a=2+7/3
4."="是一个赋值号,不是一个等号。
5.x=y。变量的值也是可以传递和赋值的。它的意思就是将变量 Y 中的值赋值到 X
中去。同样 N=N+1 也成立
6.赋值运算符的左侧只能是变量,不能是常量或表达式 a+b=c 这就是违法的
7。赋值号的右边也可以是一个赋值表达式。如 a=b=7+1;
补充;表达式与语句的区别,
表达式后面加一个分号就是语句。
2.6.2 复合赋值表达式
例:
a+=3------a=a+3 同理可得 a*=3 /= -=
a+=a-=a+a a 的初值是 9
a+=a-=18
a+=(a=a-18)
a+=(a=-9)
a+=a
-18
(15)若有定义语句:int x=10;,则表达式 x-=x+x 的值为( B )
A)-20 B)-10 C)0 D)10
(14)设有定义:int x=2;,以下表达式中,值不为 6 的是 ( D )
A) x*=x+1 x=x*(x+1) B) x++,2*x
C)x*=(1+x) D)2*x,x+=2
(17)若变量均已正确定义并赋值,以下合法的 C 语言赋值语句是 (A)
A)x=y==5; B)x=n%2.5; C)x+n=I D)x=5=4+1;
2.7 ++ 和— —的讲解
++:自身加 1
--:自身减 1
如
i=3 i++_______I=i+1 i=4
单目
3++
++I I++
当++在前,先自身加 1,然后再干别人让干的事情 。
当++在后,先别人让干的事情然后再干 自身加 1。
int i=3;
int a;
a=i++; a=3
a=++I;a=4
第三课:输入和输出语句
3.2 输出语句的讲解
一、printf 函数的一般调用形式
在高压缸排汽的总管上装有动力控制止回阀,以便在事故情况下切断,防止蒸汽返回到汽轮机,引起汽轮机超速。在高压缸排汽总管的端头有蒸汽冲洗接口,以供在管道安装完毕后进行冲洗,在管道冲洗完成后用堵头堵死。center pin checks and anchoring the inner cylinder. According to While coupling alignment should keep oil out of cavity and locate the rotor axis neck raised are within the prescribed limits, there should be no gaps, Horn, Horn and Horn 0.05mm feeler gauges fit into. Center coupling, condenser water filling and water-filled according to factory requirement. For coupling three supported rotor Center, the mouth under the coupling between the value should be as stipulated in the manufacturer, usually 0.15~0.25mm. In the case of coupling connection, if possible, lifting only one bearing end of the support bearing of the rotor, remove the bearing, fitted with special tiles and special lifting tools, disc rotors, check the journal flutter tile, should generally be less than 0.10MM. When the couplings and rotor comes when there is a conflict, the coupling Centre shall prevail. 6.4.5.2.2 shaft looking for: ... 6.4.5.3. Provisional bolt confirmed the positioning of the rotor size, as well as the coupling between the adjustment shim thickness accuracy, drawings to meet the technical requirements. Plane, cylindrical and clean the coupling bolt holes should be clean and without burrs, scrap iron and grease-free, relative position of the coupling according to the drawing requirements are. Coupling top screws, round distance apart, indicators to monitor movement of the aircraft, its value is allowed to pass the value axis moving, mounted adjustment pads, note pads installation direction guide pin coupling with process end closed. The back wheels slowly tightened, when 2mm or so, with standard white bars where two back wheel bolt hole measurement above and below, confirm two back wheel bolt hole concentricity. Then, the symmetrical horizontal mount two temporary bolts tightened, attention to monitor dial indicator, then install the symmetrical temporary bolts, this time sites slowly moving rotor, in the measured circumference of 8 equal parts back wheel rim rock, each measuring relative changes in value should be less than 0.02mm. 6.4.5.4 coupling reamed and paired bolt reaming die reamer, adjustable reamers, boring mill, in several ways. 6.4.5.4.1 General requirements before reaming or boring,
格式:printf(格式控制,输出项 1,输出项 2,.......);
在 printf 函数的最后面写上;号就是输出语句。
1,给输出项白提供输出格式说明
格式说明符:
作用:就是使数据按格式说明符的要求进行输出。
组成:由%号和紧跟在其后的格式描述符组成。
int--------%d
float 或 double---%f 或 e%
char--------%c
2.提供原样输出的文字或字符
在 “ ” 中除了格式说明符之外的内容要全部原样输出。
各个输出项之间要用逗号隔开。
输出项可以是任意合法的常量,变量或表达式。
printf 中常用的格式说明
在格式说明符中,每一个格式说明符都必须以%号开头由相应的类型标识字母结束。
但在他们之间可以有其它的一个内容:
%c :输出一个字符
%d:输出一个十进制的数据
%o:以八进制格式输出。
%X:以十六进制输出
%U:无符号十进制输出
%f:以带小数点的数字输出
%e:以指数形式输出
%s:输出一个字符串。
%%:输出一个%号
%4d:输出的数据长度是 4 个长度,当原来的长度大于 4 个时会自动突破。小于 4 个时会
填充空格。
%x.yf: x 代表数制的宽度(包括小数点)。Y 代表小数点后面的小数位数。
注意事项:
1.输出比较自由一些,输出有的各个数之到底是什么,取决于格式说明符之间的内容。
2.格式说明符要与输出项一一对应。
3.输出语句中还可以有 \n \r \t \a
4.尽量不要在输出语句中改变输出变量的值。
5.输出的数据中如果存在变量,一定要定义过的。
输入语句
格式: scanf(格式控制,输入项 1,输入项 2,...);
例如:想通过键盘输入 3 个数分别给变量 a,b,c。并且他们分别为整型,浮点型,双精度
型。
输入语句为 scanf("%d%f%lf",&k,&a,&y);
说明:
1.格式说明符与输出语句一样。
剩余62页未读,继续阅读
资源评论
黑色的迷迭香
- 粉丝: 703
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功