科C语言程序设计A复资料抄
单选题
1.C语言程序中必须包含样函数该函数函数名(A)
A main B MAIN C name D function
2.C语言程序文件编译错误分(B)类
A 1 B 2 C 3 D 4
3 字符串a+b12\n长度(B)
A 6 B 7 C 8 D 9
4 switch语句case块中假定break语句结束switch语句容易改写(D)语句
A for B while C do D if
5 面dowhile循环语句中循环体语句执行次数(C)
int i0 do i++ while(i<10)
A 8 B 9 C 10 D 11
6 两字符串连接起组成字符串时选字符串函数(C)
A strlen() B strcpy()
C strcat() D strcmp()
7 数组名作函数调实参传递形参(A)
A 数组首址 B 数组中第元素值
C 数组中全部元素值 D 数组元素数
8 假定a整数类型数组名整数类型长度4元素a[4]址a数组首址(C)字节
A 4 B 8 C 16 D 32
9 假定s定义指针类型char *变量初始指字符串Hello world变量p指s指字符串p应定义(A)
A char *ps B char *p&s
C char *pp*s D char *p p&s
10 数文件中读入换行符结束行字符串函数(B)
A gets() B fgets()
C getc() D fgetc()
11.程序运行中需键盘输入数时数间默认(D)符号作分隔符
A.空格逗号 B.逗号回车
C.逗号分号 D.空格回车
12.逻辑表达式(x>0 && x<10)相反表达式(A)
A.x<0 || x>10 B.x<0 && x>10
C.x<0 || x<10 D.x>0 && x>10
13.处理特定问题时循环次数已知时通常采(A)循环解决
A.for B.while C.dowhile D.switch
14.假定i初值0循环语句while(i
15.假定二维数组定义语句int a[3][4]{{34}{286}}元素a[1][2]值(C)
A.2 B.4 C.6 D.8
16.列选项中正确函数原型格式(C)
A.int Function(int a) Bvoid Function (char)
C.int Function(a) Dvoid int(double* a)
17.假定p指float型数指针p+1指数址p指数址(C)字节
A.1 B.2 C.4 D.8
18.假定定义int m7 *pp赋值正确表达式(B)
A.pm B.p&m C.*p&m D.p*m
19.假定指针变量p定义int *pmalloc(sizeof(int))释放p指动态存储空间应调函数(A)
A.free(p) B.delete(p) C.free(*p) D.free(&p)
20.C语言中系统函数fopen()( D)数文件函数
A.读取 B.写入 C.关闭 D.开
21 C语言源程序文件缺省扩展名(D)
A cpp B exe C obj D C
22.设xy均逻辑值x && y真条件(A)
A 均真 B 中真
C 均假 D 中假
23 列符号常量定义中正确定义格式(C)
A #define M1 B const int M2 20
C #define M3 10 D const char mark
24 for循环语句够改写(D)语句
A 复合 B if C switch D while
25 面维数组定义中错误定义格式(C)
A int a[]{123} B int a[10]{0}
C int a[] D int a[5]
26.面函数原型声明中存语法错误(C)
A AA(int a int b) B AA(int int)
C AA(int a int b) D AA(int a int)
27 假定a数组名面存错误表达式(B)
A a[i] B *a++ C *a D *(a+1)
28 假定定义int a[10] x *paa数组a中标3元素值赋x正确赋值(D)
A xpa[3] B x*(a+3)
C xa[3] D x*pa+3
29.char类型长度(A)字节
A 1 B 2 C 3 D 4
30 二进制文件中写入信息函数(D)
A fgets() B fputs()
C fread() D fwrite()
31 C语言目标文件连接成执行文件缺省扩展名(B)
A cpp B exe C obj D c
32 设两条语句int a12 a+a*a执行结束a值(C)
A 12 B 144 C 156 D 288
33 带机函数调表达式rand()20值(C)区间
A 1~19 B 1~20 C 0~19 D 0~20
34 for循环语句for(i0 i
35 列字符数组定义中存语法错误(D)
A char a[20]abcdefg B char a[]x+y55
C char a[15]{'1''2'} D char a[10]'5'
36 函数原型double *function()返回值类型(B)
A 实数型 B 实数指针型
C 函数指针型 D 数组型
37 C语言中预处理命令(B)符号开头(B)
A * B # C & D @
38 假定整数指针p指数单元值30p+1指数单元值40执行*p++p指数单元值(A)
A 40 B 30 C 70 D 10
39 p指二维整型数组a[10][20]p类型(D)
A int * B int ** C int *[20] D int(*)[20]
40 表示文件结束符符号常量(C)
A eof B Eof C EOF D feof
41 C语言程序中基功模块(D)
A表达式 B标识符 c语句 D函数
42逻辑表达式(x>0||y5)相反表达式(B)
Ax
43循环体少执行次循环语句 (C)
Afor Bwhile Cdowhile D种循环
44假定 n值5表达式n++值(B)
A6 B5 C4 D7
45假定二维数组定义int a[3][4]{{34}{286}}号元素a[2][O]值(A)
A0 B2 C4 D6
46假定函数原型char *func(int n)该函数返回类型(D)
A int B int* cchar Dchar*
47假定a字符数组名元素a[i]指针访问方式(B)
Aa+i B*(a+i) C&a+i D*a+i
48假定语句int *pcalloc(10+20sizeof(int))p指动态数组中包含元素数(C)
A10 B20 c30 D40
49十进制数 50表示成符合C语言规定八进制数(D)
A 20 B32 C62 D062
50读写两种操作方式开二进制文件文件存时返回开失败信息选开方式字符串(C)
Ar+ Bab+ C rh+ Dwb+
二填空题
1C语言程序文件中包含外头文件程序文件应预处理命令(#include )
2键盘变量输入值标准输入函数函数名(scanf)
3假定枚举类型定义enum RA{abacadae}ac值(1)
4 double类型长度(8)
5执行int x45 y13 printf(dxy)语句序列输出结果(3)
6表达式xx+y转换成复合赋值表达式(x+y)
7假定x值5执行a((x)1020)语句a值(20)
8假定维字符指针数组定义char* a[8]该数组占存储空间字节数(32)
9假定二维数组定义double a[M][N]数组元素行标取值范围(0~M1)间
10空字符串长度 (0)
11函数定义外定义变量没初始化系统隐含赋初值(0)
12p指x(*p)x表示等价
13 直接访问表达式(*fp)score应间接访问表达式(fp>score)
14.函数定义 函数头_函数体两部分组成
15 执行printf(c'F'2)语句输出结果 D
16.int类型长度 4
17 表达式(float)254值 625
18.x5y10x
20 程序中执行 return 返回 语句时结束函数执行程返回调该函数位置
21 假定二维数组定义char a[M][N]该数组含元素数 M*N
22 存储字符'a'需占存储器_1_字节空间
23 存储长度n字符串字符数组长度少_n+1_
24 假定p指象值25p+1指象值46执行表达式(*p)++p指象值_26_
25 假定p指整数象指针 *p 表示该整数象
26.假定结构类型定义struct B{int a[5] char* b}该类型理长度_24_
27 C语言中条复合语句_ }(右花括号)作结束符
28 #include命令中包含文件头文件_程序_文件
29 十进制数35应八进制数 43
30 假定x5表达式2+x++值 7
31.增量表达式++y表示成赋值表达式yy+1
32.x5y10x>y值0(假)
33 假定二维数组定义int a[3][5]该数组含元素数15
34 执行typedef int ABC[10]语句ABC定义具10整型元素_数组_类型
35 strcat()函数连接两字符串
36.假定p指象值25p+1指象值46*p++值 25
37 整型指针p转换字符指针采强制转换表达式(char*)p
38 NULL符号常量通常作空指针值应值 0
39 假定动态分配类型struct Worker象r指针指象表达式 struct Worker* r malloc(sizeof(struct Worker))
40 C语言程序文件中包含外头文件程序文件应预处理命令#include
41 键盘变量输入值标准输入函数函数名scanf
42 假定枚举类型定义enum RA{abacadae}ac值_1
43.double类型长度_8_
44 执行int x45y13printf(dxy)语句序列输出结果_3_
45 表达式xx+y表示成复合赋值表达式 x+y
46 假定x5执行a(x 10 20)语句a值_20_
47 假定维字符指针数组定义char* a[8]该数组占存储空间字节数_32_
48 假定二维数组定义double a[M][N]数组元素行标取值范围_0~M1 间
49 空字符串长度_0_
50 函数外定义变量没初始化系统隐含赋初值 0_
51 p指x *p x表示等价
52 结构成员访问表达式(*fp)score等价表达式 fp>score
53.执行printf(c'A'+2)语句输出结果_C_
54.short int类型长度_2_
55 类型关键字表示十进制常数326f类型 float
56 假定y10表达式++y*3值_33_
57 逻辑表达式(x0 && y>5)相反表达式(x0 || y<5) :(x || y<5)
58.x5y10xy逻辑值_1(真true)_
59 假定二维数组定义int a[3][5]该数组占存储空间字节数_60_
60 typedef char BB[10][50]语句定义_BB_含10行50列二维字符数组类型
61 字符串a\\xxk\\filetxt长度_15_
62.假定p指象值25p+1指象值46*++p值_46_
63 假定数象int*类型指该象指针类型_int**_
64.假定结构类型定义 struct A{int ab A* c}该类型理长度_12_
65 假定访问结构象x中数成员a表示方式_xa_
三写出列程序运行输出结果
1 #include
void main() {
int ijk0
for(i0 i<5 i++)
for(ji j<5 j++) k++
printf(d\nk) }
运行结果:15
2 #include
void main() {
int x20
int i2
while(i
i++ } }
运行结果:2 5
3 #include
void main() {
int a[8]{7063549540759066}
int i s0
for(i0 i<8 i++)
if(a[i]>70 && a[i]<90) s+a[i]
printf(sd\ns) }
运行结果:s235
4 #include
int WF(int x int y) {
xx+y
y+x
return x+y }
void main() {
int x3 y5
printf(d\nWF(xy)) }
运行结果: 21
5 #include
int LA(int *a int n) {
int is0
for(i0i
void main() {
int a[5]{12345}
int bLA(a5)+LA(a+13)
printf(bd\nb) }
运行结果: b24
6 #include
void main() {
int x5
switch(2*x1) {
case 4 printf(d x) break
case 7 printf(d 2*x) break
case 10 printf(d 3*x) break
default printf(s default) }
printf(s\nswitch end) }
运行结果:default switch end
7 #include
void main() {
int f1f2i
f11
printf(d f1)
for(i2i<5i++) {
f23*f1+1
printf(d f2)
f1f2 }
printf(\n) }
运行结果: 1 4 13 40 121
8 #include
void main() {
int a[10]{12392641556372408395}
int i i10 i20
for(i0i<10i++)
if(a[i]21) i1++ else i2++
printf(d d\ni1i2) }
运行结果:6 4
9 #include
#include
void main( ) {
char s[15]567891234
int i nstrlen(s)
for(i0 i
s[i]s[n1i]
s[n1i]c }
printf(s\ns) }
运行结果:432198765
10 #include
int LB(int *a int n) {
int is1
for(i0i
void main() {
int a[]{12342452}
int bLB(a4)+LB(a+33)
printf(bd\nb) }
运行结果: b56
11 #include
void main() {
int i s0
for(i1i++) {
if(s>30) break
if(i20) s+i }
printf(sd\ns) }
运行结果:s42
12 #include
void main() {
int a[9]{362548245540186620}
int i b1 b2
b1b2a[0]
for(i1 i<9 i++) {
if(a[i]>b1) b1a[i]
if(a[i]
运行结果:66 18
13 #include
void SB(char ch) {
switch(ch) {
case 'A' case 'a'
printf(WW ) break
case 'B' case 'b'
printf(GG ) break
default
printf(BB ) break } }
void main() {
char a1'a'a2'B'a3'f'
SB(a1)SB(a2)SB(a3)
printf(\n) }
运行结果:WW GG BB
14 #include
#define M 6
void main() {
int ix
int a[M]{101522374658}
for(i0 i
for(i0 i<6 i++) printf(d a[i])
printf(\n) }
运行结果:58 46 37 22 15 10
15 #include
struct Worker {
char name[15] int age float pay }
void main() {
struct Worker x{wanghua522350}
struct Worker y *p
yx p&x
printf(d 72f\n yage+p>age p>pay+20) }
运行结果:104 237000
16 #include
void main() {
int is0
for(i1i<6i++) s+i*i
printf(sd\ns) }
运行结果: s55
17 #include
#define N 6
void main() {
int ia[N]{258101521}
for(i0 i
printf(\n) }
运行结果: 2 8 21
18 #include
#include
void main() {
int i
unsigned int len
char* a[5]{studentworkercadresoldierzzeasan123}
lenstrlen(a[0])
for(i1 i<5 i++)
if(strlen(a[i])>len) lenstrlen(a[i])
printf(d\nlen) }
运行结果:10
19 #include
void main() {
int ab
for(a2b3 b<20) {
printf(d d ab)
aa+b
ba+b }
printf(d d\nab) }
运行结果:2 3 5 8 13 21
20 #include
void LE(int* a int* b) {
int x*a
*a*b *bx }
void main() {
int x15 y26
printf(d d\nxy)
LE(&x&y)
printf(d d\nxy) }
运行结果:15 26
26 15
21 #include
void main() {
int i s10 s20
for(i0i<10i++)
if(i2) s1+i
else s2+i
printf(d d\ns1s2) }
运行结果: 25 20
22 #include
const int M20
void main() {
int i2
while(1) {
if(i>M2) break
if(Mi0) printf(d i)
i++ }
printf(\n) }
运行结果: 2 4 5 10
23 #include
int a[6]{456152012}
void main() {
int is1s2
s1s20
for(i0 i<6 i++) {
switch(a[i]2) {
case 0 s2+a[i]break
case 1 s1+a[i]break } }
printf(d d\ns1s2) }
运行结果:20 42
24 #include
void main() {
int a[3][3]{{357}{91113}{6820}}
int i*p&a[0][0]
for(i0i<9i++) {
if(*p>10) printf(d *p)
p++ }
printf(\n) }
运行结果:11 13 20
25 #include
#include
struct Worker { char name[15] int age float pay}
void main() {
struct Worker x
char *tliouting
int d38 float f400
strcpy(xnamet)
xaged xpayf
xage++ xpay*2
printf(s d 62f\nxnamexagexpay) }
运行结果: liouting 39 80000
26 #include
void main() {
int ij k0
for ({iOi<5i++)
for(jij<5j++) k++
printf(d\nk) }
运行结果:15
27 #include
void main() {
int x20
int i2
while(i
i++ }}
运行结果:25
28 #include
void main() {
int a[8]{7663549540759066}
int i s0
for(i0i<8i++)
if(a[i]>70 && a[i]<90) s+a[i]
printf(sd\ns) }
运行结果:s241
29 #include
int WF(int x int y) {
xx+y
y+x
return x+y }
void main() {
int x3 y8
printf(d\n WF(xy))}
运行结果:30
30 #include
int LA(int *aint n) {
int isO
for(iO i
void main() {
int a[5]{1 2345}
int bLA(a5)+LA(a+23)
printf(bd\nb)}
运行结果:b27
四写出列函数功
1 int WC(int a[]int n int k) {
int i cO
for(iO i
return c }
函数功统计返回维整型数组a[n]中等k值数
2 void QA(struct Worker a[]int n)
{int i
for(iO i
假定结构类型 struct Worker定义
struct Worker{char name[15]int agefloat pay}
函数功键盘具struct Worker类型数组a[n]输入n记录
3 #include
int SA(int a int b) {
if(a>b) return 1
else if(ab) return 0
else return 1 }
函数功:较两整数aba>b返回1ab返回0a
4 void Output(struct IntNode *f) f单链表表头指针
{ if(f) return
while(f) {
printf(d f>data)
ff>next }
printf(\n) }
假定struct IntNode类型定义:
struct IntNode { int data struct IntNode* next}
函数功:遍历输出f指单链表中结点值
5 int SG(int x) { x等2整数
int i2
if(x2 || x3) return 1
while(i*i
i++ }
if(i*i
6 int FindMax(struct IntNode *f)
f单链表表头指针
{ int x
if(f) {printf(单链表空\n)exit(1)}
xf>data
ff>next
while(f) {
if(f>data>x) xf>data
ff>next }
return x }
假定struct IntNode结点类型定义:
struct IntNode { int data struct IntNode* next}
函数功:求出返回f指单链表中结点值
五题目求编写程序函数
1 编写程序计算1+3+32++310值输出假定分ips作循环变量累变量累加变量标识符
程序:
#include
void main(){
int i
int p1
int s1
for(i1i<10i++) {p*3 s+p}
printf(d\ns) }
2 根函数原型int FF(int a[] int n)编写函数定义计算返回数组a[n]中元素
程序:
int FF(int a[] int n) {
int isum0
for(i0 i
3 编写函数计算1+3+32++310值输出假定分ips作循环变量累变量累加变量标识符
程序:
#include
void main(){
int i
int p1
int s1
for(i1i<10i++) {p*3 s+p}
printf(d\ns) }
4 根函数原型int FF(int a[] int n)编写函数定义计算返回数组a[n]中元素
程序:
int FF(int a[] int n) {
int isum0
for(i0 i
5 编写程序输出50(含50)够3者5整整数
程序:#include
void main() {
int i
for(i3 i<50 i++)
if(i30 || i50) printf(d i)
printf(\n) }
6 编写递函数int FF(int a[] int n)求出数组a中n元素积返回
程序: int FF(int a[] int n){
if(n<0) {printf(n值非法\n)exit(1)}
if(n1) return a[n1]
else return a[n1]*FF(an1) }
7 编写程序输出50(含50)够3者5整整数
#include
void main() {
int i
for(i3 i<50 i++)
if(i30 || i50) printf(d i)
printf(\n) }
8 编写递函数int FF(int a[] int n)求出数组a中n元素积返回
int FF(int a[] int n) {
if(n<0) {printf(n值非法\n)exit(1)}
if(n1) return a[n1]
else return a[n1]*FF(an1) }
9根函数原型double Mean(double a[M][N] int m int n)编写函数定义求返回二维数组a[m][n]中元素均值假定计算程中采变量v存放累加值均值
double Mean(double a[M][N] int m int n) {
int ij
double vO0
for(iO i
return v } 注函数体两行合条返回语句return vm*n掉
10根函数原型int MM(int a[]int m)编写函数定义计算返回数组a[m]中元素值值差
int MM(int a[]int m){
int ix1x2
xlx2a[0]
for(i1 i
if(a[i]
请您删容O(∩_∩)O谢谢2015年中央电期末复考试抄全电期末考试必备抄电考试必抄请您删容O(∩_∩)O谢谢2015年中央电期末复考试抄全电期末考试必备抄电考试必抄The battle for young viewers CCTV is embracing Internet culture and working with independent producers on TV shows to woo audiences under 35 Han Bing bin reports After charming audiences with his warm smile for 14 years China Central Television host Li Jiaming recently found himself targeted by a group of young netizens unhappy with his style The complaints came after Li hosted the premiere of Rising Star on Oct 31 It is a singing competition show that originated in Israel Many young netizens found his hosting style slow and boring and mocked it as CCTV evening gala style They even initiated an online campaign to replace him The 40yearold host's reaction to the criticism was surprising During the second episode he jokingly called himself the slow Jiaming and acted much younger talking faster and louder It's like selling a product When the customers file a complaint you must change says Li In the Internet age you get feedback very quickly These young people are so cute When you're willing to change for them they will quickly like you back In order to win more young viewers CCTV is relying on programs such as Rising Star to embrace Internet culture In Rising Star a studio audience and fans watching on television vote for their favorite singers in real time using the instantmessaging app WeChat Rising Star was designed to be a live broadcast but the Chinese version isn't because of policy reasons Still WeChat votes by viewers at home are still a major factor in determining which contestants advance to the next round In the show's latest episode more than 65 million votes were cast via WeChat Now the competition among entertainment shows is very fierce Audiences have more diverse needs CCTV needs to embrace an open attitude interact with young audiences and blend with the Internet says Lyu Yitao director of CCTV's entertainment channel The producer of Rising Star Enlight Media says the program will have a phenomenal effect given CCTV's audience base nationwide But it comes with a challenge says Zhang Hang chief producer of the program and CEO of Enlight Media's TV business Unlike topranking provincial satellite channels such as Hunan TV which have a large base of young fans thanks to a series of phenomenally popular entertainment and reality shows CCTV productions are usually more conservative and serious and thus have a much older audience base If we were to run this program on Hunan we may attract twice as many viewers says Zhang But since we didn't make it there we now have to make the best out of the given conditions And it means we have to make certain compromises When the current season of Rising Star ends Zhang says his company will conduct an overall evaluation of the program and make adjustments for future seasons Although audience ratings haven't lived up to Zhang's expectations he says the program has already helped CCTV attract more young people According to Enlight Media the number of people ages 15 to 35 who watched the first episode of Rising Star was 76 percent higher than the usual audience for CCTV entertainment productions In order to attract young audiences CCTV has been working with independent production companies As one of CCTV's closest partners Enlight Media has produced several entertainment and reality shows for the company's channels including the Chinese version of The Biggest Loser on CCTV's business channel and an original teenager talent show Shaonian Zhongguo-qiang (Strong Young Chinese) on CCTV1 This year CCTV also licensed EEMedia the producer of the popular Super Girl talent shows to produce the talk show Hi 2014 hosted by Taiwan pop star Harlem Yu and one of China's most popular TV stars Xie Na The show is geared toward younger audiences Canxing Productions which rose to fame with the success of its Voice of China series on Zhejiang TV also produced two talent shows for CCTV One is an original production called Songs of China which ended up as one of CCTV's most watched programs of 2014 The State Administration of Press Publication Radio Film and Television announced earlier this year that starting in 2015 only one music talent show can be aired nationwide during prime time each season and there can be only one program based on foreign formats each year However domestic media report that such policies don't apply to CCTV meaning it will become a highly desired platform by production companies Wang Changtian CEO of Enlight Media confirmed to the Shanghai Securities News that its programs scheduled to air on CCTV next year which include at least two reality shows won't be affected A kung futhemed reality show produced by Canxing is also reportedly scheduled to run on CCTV next year CCTV is very active The level of its acceptance of new ideas is even beyond my imagination says Zhang Hang Our cooperation with CCTV will surely continue When winter comes nothing is more relaxing than a hot spring bath For thousands of years natural mineralrich hot spring baths have also been used to relieve health ailments The water found in natural hot springs contains a variety of different minerals and the most common one is sulfur It has a rotten egg smell but is excellent for skin The sulfurcontaining water might be just what the doctor ordered when it comes to relieving pain stress itchy skin arthritis and more Hot springs resorts are thriving as biting cold winter arrives Here we take a look at some of the best natural hot springs China has to offer
文档香网(httpswwwxiangdangnet)户传
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档