作业帮 > 初中作文 > 教育资讯

a,x-y,b,y-x,c,x-y

来源:学生作业帮助网 编辑:作业帮 时间:2024/09/24 00:27:13 初中作文
a,x-y,b,y-x,c,x-y初中作文

篇一:2012级C语言期末考试B卷(含答案)

桂林电子科技大学信息科技学院试卷

课号 课程名称 C语言程序设计 (B卷;、闭卷) 适用班级(或年级、专业) 12级、全院

一 单项选择题(每小题2分,共40分) 1. 一个C语言程序是从____开始执行的

A)程序中第一个函数 B)名为main的函数 C)包含文件(头文件)的第一个函数 D)程序中的第一个语句

2 .已知 int i=65;则putchar(i);printf("%d",i);printf("%c",i);的输出结果为____ A) A,65,A B) 65,65,A C) A,A,65 D) A,A,A

3. 假设在程序中a,b,c 均被定义成整型,并且已赋大于1的值,则下列能正确表示代数式

1

的表达式是____。

abc

A) 1/a*b*c B)1/(a*b*c) C) 1/a/b/ (float) c D)1.0/a/b/c

4 . 若x, y, z均为整型常量,且a=100, 则执行下列语句后的z值为____。

x = a++;y= --a;z=x+y-a--;

A)100 B)400 C)200 D)300

5. 设a、b和c都是int型变量,且a=3,b=0,c=5,则以下值为0的表达式是 。

A 'a'&&'b' B a&&b||c C a&&b&&c D a||b&&c 6.下列程序运行后的输出的数据是 。

main()

{ int x,y,z; x=y=2; z=3;

y=x++-1; printf("%d\t%d\t",x,y); (3,1) y=++x-1; printf("%d\t%d\n",x,y); (4,3) y=z---1; printf("%d\t%d\t",z,x);(2,4) y=--z-1; printf("%d\t%d\n",z,x);(1,4) }

A. 3 1 4 3 B. 3 1 3 3

2 4 1 4 2 4 2 2 C. 3 1 4 3 D. 2 1 3 2 7. 以下程序的输出结果是 。

main()

{ int x=4,y=7; x-=y; y+=x;

printf("%d %d\n",x,y); }

A) 4 7 B) -3 -3 C) -3 11 D) -3 8. 当a=1,b=3,c=5,d=4时,执行下面一段程序后,x的值是 。

if(a

if(c

if(b

else x=7;

A) 1 B) 2 C)3 D)6 9.有以下程序

#include main()

{ char c1,c2,c3,c4,c5,c6;

scanf("%c%c%c%c",&c1,&c2,&c3,&c4); c5=getchar(); c6=getchar(); putchar(c1); putchar(c2); printf("%c%c\n",c5,c6); }

程序运行后,若从键盘输入(从第1列开始) 123<回车> 45678<回车>

则输出结果是 。

A) 1267 B) 1256 C) 1278 D) 1245 10.在嵌套使用if语句时,C语言规定else总是 。

A) 和之前与其具有相同缩进位置的if配对 B) 和之前与其最近的if配对

C) 和之前与其最近不带else的if配对 D) 和之前的第一个if配对 11. 有如下程序

4

main()

{ int n=9;

while(n>6) { n- -; printf("%d",n); } }

该程序的输出结果是 。

A)987 B)876 C)8765 D)9876 12. 有以下程序段

int k=0;

while(k=1) k++;

while循环执行的次数是 。

A)无限次 B)有语法错,不能执行 C)一?a href="http://www.zw2.cn/zhuanti/guanyuwozuowen/" target="_blank" class="keylink">我膊恢葱? D)执行1次 13. 以下叙述正确的是 。

A)do-while语句构成的循环不能用其它语句构成的循环来代替 B)do-while语句构成的循环只能用break语句退出

C)用do-while语句构成的循环,在while后的表达式为非零时结束循环 D)用do-while语句构成的循环,在while后的表达式为零时结束循环 14. 有如下程序

main()

{ int x=23; do

{ printf("%d",x- -); }while(!x); }

该程序的执行结果是 。

A)321 B)23 C)不输出任何内容 D)陷入死循环 15. 以下程序的输出结果是 。

main()

{ int i=0,a=0; while(i<20) { for(; ;)

if((i%10)= =0) break; else i- -; i+=11; a+=i; }

printf("%d\n",a); }

A)21 B)32 C)33 D)11 16. 以下循环体的执行次数是 。

A)3 B)2 C)1 D)0

main()

{ int i,j;

for(i=0,j=1; i<=j+1; i+=2,j- -) printf("%d \n",i);

}

17. 以下对一维整型数组m的正确定义(说明)的是 。

A) int n=10,a(n); B)int n=10,a[n]; C) #define n 10 D) #define n 10

int a[n]; int a(n);

18. 若有以下说明,则数值为4的表达式是 。

int a[12]={1,2,3,4,5,6,7,8,9,10,11,12}; char c='a',d,g;

A) a[g-c] B) a[4] C) a['d'-'c'] D) a['d'-c] 19. 已定义a为int型变量,则 是对指针变量p的正确说明和初始化。

A) int p=&a; B) int *p=a; C) int *p=*a; D) int *p=&a; 20. C语言文件操作函数fread(buffer,size,n,fp)的功能是 。

A) 从文件fp中读n个字节存入buffer

B) 从文件fp中读n个大小为size字节的数据项存入buffer中

C) 从文件fp中读入n个字节放入大小为size字节的缓冲区buffer中 D) 从文件fp中读入n个字符数据放入buffer中 二 填空题(每题3分,共30分)

1. 设x为int型变量,请写出描述“x是偶数”的表达式是

2. 已知 scanf("a=%d,b=%d,c=%d",&a,&b,&c); 若从键盘输入2、3、4三个数分别作为变量a、b、c的值则正确的输入形式是

3. 设有语句 int a=3; 则执行了语句 a+=a-=a*a后,变量a 的值是 4.以下程序的输出结果是。

#include main()

{ int i=010 , j=10;

printf("%d,%d\n",++i,j--); }

5. 若用数组名作为函数调用的实参,传递给形参的是 。 6.设有有程序:

main()

{ int i=5,j,k; j=i+++i+++i++;

k=(++i)+(++i)+(++i);

printf("i=%5d j=%5d\nk=%5d\n",i,j,k); }

则运行程序后的输出是 。

7. 以下程序运行后的输出结果是 。

main()

{ int m=5; switch(m/2) { case 1: m++;

case 2: m+=3;

case 5: m+=6;break; default: m-=7; }

printf("%d\n",m); }

8. 以下程序的输出结果是 。

main()

{ int s,i;

for(s=0,i=1;i<3;i++,s+=i); printf("%d\n",s); }

9 以下程序的输出结果是 。

main()

{ char ch[]="abc",x[3][4]; int i; for(i=0;i<3;i++) strcpy(x[i],ch);

for(i=0;i<3;i++) printf("%s",&x[i][i]); printf("\n"); }

10 以下程序运行结果是 。

int a=1; int f(int c)

{ static int a=2; c=c+1;

return (a++)+c; }

main()

{ int i,k=0;

for(i=0;i<2;i++){ int a=3; k+=f(a); } k+=a;

printf("%d\n",k); }

三 程序填空题(每空3分,共30分)

1. 以下程序的功能是:输入一个小写字母,输出对应的大写字母,将程序补充完整。

main()

{ char ch ;

【1】 /* 从键盘输入一个小写字母 */

篇二:SAT 数学教程全解析

www.satonline.cn SAT免费在线做题测评网

SAT 数学教程全解析

I. 解题技巧训练

1 The units digit of 23333 is how much less than the hundredths digit of 567

1000

(A) 1 (B) 2 (C) 3 (D) 4 (E) 5

备考SAT下载Satonline手机APP

2. What is the units digit of 1597365?

stack?

A. 14 B. 17 C. 18 D. 24 E. 34

of the following could be equal to xy?

A. 5 B.70 C. 105 D. 140

(B) 16 (C) 8 (D) 4 (E) 2

6. xequal t?

A. 1 B. 2

B. 8 C. 10 D.12 E. 23

C. 10 D. 13 E. 30

If x is a positive integer greater than 1, and x3-4x is odd, then x must be

(A) even (B) odd (C) prime (D) a factor of 8 (E) divisible by 8

10.

If the graph above is that of f(x), which of the following could be f(x) |x|x||A. f(x)= 3 B. f(x)=3 C. f(x)=/x/+3 D. f(x)=|x+3| E. f(x)=|3x|

www.satonline.cn SAT免费在线做题测评网

11. xy=x+y. If y>2, what are all possible values of x that satisfy the equation above?

A. x<0, B. 02

II. 算术 ――对应知识点训练

A. Doubling each number

B. Increasing each number by 10

C. Increasing the smallest number only

D. Decreasing the largest number only

E. Increasing the largest number only

www.satonline.cn SAT免费在线做题测评网

(6). The least and greatest numbers in a list of 7 real numbers are 2 and 20, respectively. The median of the list is 6, and the number 3 occurs most often in the list. Which of the following could be the average (arithmetic mean) of the numbers in the list?

I. 7 II. 8.5 III. 10

A. I only B. I and II only C. I and III only D. II and III only E. I, II and III

3. 集合部分

odd numbers from 1 to 20 inclusive. If f is the number of values in set F, gof in Set G, and j is the number of values in F∪of f(j-g)?

A. 4 B. 8 C. 10 D. 11 E. 18

Set X or Set Y with the exception of the k common the following represents the number of members in set Z?

A. x+y+k B. x+y-k C. x+y+2k D. x+y-2k

A. 20 B.40 C. 80 D.120 E. 200

g is the number of values of in Set G, and jG, which of the following gives the correct value of f(j-g)?

A. 4 B. 8 4. 排列组合题

(10)Mr. following 5 flavors of jellybean: apple, berry, coconut, (11

the 5 cards shown above are placed in a row

so that

is never at either end, how many

(12

As shown above, a certain design is to be painted using 2 different colors. If 5 different colors are

www.satonline.cn SAT免费在线做题测评网

available for the design, how many differently painted designs are possible?

A. 10 B. 20 C. 25 D. 60 E. 120

(13)In the integer 3589 the digits are all different and increase from left to right. How many integers between 4000 and 5000 have digits that are all different and that increased from left to right?

(14)

.

On the map above, X represents a theater, Y represents Chris’s Z ’s house. Chris walks from his house to Peter’s house without then walks with Peter to the theater and then walks without walking by How many different routs can Chris take?

(15)In a certain game, 8 cards are randomly a table. The cards are

(16)

(17)

5.

A. 25 B. 26 C.50 D. 51 E. 52

….

All integers appear in the sequence above, and each positive integer k appears in the terms before it. If the integer 12 first appears in the sequence as the nth term, what is the value of n?

(16) The first term of a sequence of numbers is 2. Subsequently, every even term in the sequence is found by subtracting 3 from the previous term, and every odd term in the sequence is found by adding 7 to the previous term. What is the difference between 77th and 79th terms of this sequence?

www.satonline.cn SAT免费在线做题测评网

A. 11 B. 7 C. 4 D. 3 E. 2

6.应用题

(16) A positive integer is said to be “tri-factorable” if it is the product of three consecutive integers. How many positive integers less than 1000 are tri-factorable?

(23) On 5 math tests, Gloria had an average score of 86. If all test scores are integers, what is the lowest average score average score Gloria can receive on the remaining 3 tests if she wants to finish the semester with an average score of 90 or higher?

A. 90 B. 92 C. 94 D. 96 E. 97

(24) If

4y is the cube of an integer greater than 1, and k2=y, what is the least possible value k

篇三:C语言题

C语言试题库(第1、2、3章)

一、选择题

1、 一个C程序由若干个C函数组成,各个函数在文件中的位置为___________。

A、 任意 B第一个函数必须是主函数,其他函数任意

C必须完全按照顺序排列 D其他函数必须在前,主函数必须在最后

2、 下列四个叙述中,正确的是_______________。

A、 C程序中的所有字母都必须小写

B、 C程序中的关键字必须小写,其他标示符不区分大小写

C、 C程序中的所有字母都不区分大小写

D、 C语言中的所有关键字必须小写

3、 下列四个叙述中,错误的是_______________。

A、 一个C源程序必须有且只能有一个主函数

B、 一个C源程序可以含零个或多个子函数

C、 在C源程序中注释说明必须位于语句之后

D、 C源程序的基本结构是函数

4、 下面属于C语言关键字的是_____________。

A、int B、typedef C、enum D、unien

5、 以下叙述不正确的是____________。

A、 分号是C语句的必要组成部分

B、 C程序的注释可以写在语句的后面

C、 函数是C程序的基本单位

D、 主函数的名字不一定用mian表示

6、 C语言中允许的基本数据类型包括_______。

A、 整型、实型、逻辑型 B整型、实型、字符型

C整型、字符型、逻辑型 D整型、实型、逻辑型、字符型

7、 C语言中能用八进制表示的数据类型为________。

A、字符型、整型 B、整形、实型

C、字符型、实型、双精度型 D、字符型、整型、实型、双精度型

8、 下列属于C语言合法的字符常数是___________。

A、?\97? B、”A” C、?\t? D、”\0”

9、在VC++6.0中,5种基本数据类型的存储空间长度的排列顺序为:A、char

C、char

10、在C语言中,合法的长整型常数是____________。

A、0L B、4962710 C、0412765 D、0xa34b7fe

11、若有以下定义语句char c1=?b?, c2=?e?; printf(“%d,%c\n”,c2-c1,c2-?a?+?A?);则输出结果是__________。

A、2,M B、3,E C、2,E

D、输出项与相应的格式控制不一致,输出结果不确定

12、以下合法的赋值语句是___________。

A、x=y=100 B、d--; C、x+y D、c=int(a+b)

13、设变量t为int型,下列选项中不正确的赋值语句是____________。

A、++t; B、n1=(n2=(n3=0)); C、k=i= =m; D、a=b+c=1;

14、在以下一组运算符中,优先级最高的是____________。

A、<= B、= = C、% D、&&

15、下列能正确表示a≥10或a≤0的关系表达式是_______-。

A、a>=10 or a<=0 B、a>=10 | a<=0

C、a>=10 || a<=0 D、a>=10 && a<=0

16、下列只有当整数x为奇数时,才是逻辑“真”的表达式是_________。

A、x%2= =0 B、!(x%2= =0) C、(x-x/2*2)= =0 D、!(x%2)

17、设a为整型变量,不能正确表达数学关系10

A、10

C、a>10 && a<15 D、!(a<=10)&&!(a>=15)

18、已知x=43, ch=?A?,y=0;则表达式(x>=y&&ch

A、0 B、语法错 C、1 D、“假”

19、表达式17%4 /8的值为______________。

A、0 B、1 C、2 D、3

20、语句printf(“%d”,(a=2)&&(b= -2));的输出结果是___________。

A、无输出

二、填空题

1、 若有以下定义语句:int u=010,v=0x10,w=10; printf(“%d,%d,%d\n”,u,v,w); 则输出结果是 __________。

2、 下面程序的输出是_____________。

Main()

{unsigned a=32768;

printf(“a=%d\n”,a)}

3、 下面程序的输出是_________。

Main()

{int k=11;

printf(“k=%d,k=%o,k=%x\n”,k,k,k);}

4、 若有以下定义语句:int a=5; printf(“%d\n”,a++); 则输出结果是____________。

5、 设x为int型变量,执行以下语句,x=10; x+=x-=x-x; x的值为__________。

6、 若定义x和y为double型变量,则表达式x=1, y=x+3/2的值是__________。

7、 若t为double型变量,表达式t=1, t+5, t++的值是_________。

8、 表达式10!=9的值是______________。

9、 设x,y,z和t均为int型变量,执行以下语句:x=y=z=1; t=++x||++y&&++z; 后t的值为____________。

10、a=1,b=2,c=3,d=4,则表达式a

11、以下程序段的运行结果是___________。

int a=2,b=3;

printf(a>b?”***a=%d”:”###b=%d”,a,b);

12、假定w,x,y,z和m均为int型变量,如下程序执行后m的值为_______。

w=1; x=2; y=3; z=4; m=(w

m=(m

13、语句printf(“a\bre\?hi\?y\\\bou\n”);的输出结果是_________________。

14、以下程序的输出结果是________________。

Main()

{unsigned short a=65536;

int b;

printf(“%d\n”,b=a);} B、结果不确定 C、-1 D、1

15、若有定义int a=10,b=9,c=8; 接着顺序执行下列语句后,变量b的值为__________。

c=(a-=b-5);

c=(a%11)+(b=3);

16、设x和y均为int型变量,且x=1,y=2,则表达式1.0+x/y的值为_____________。

17、语句x++;、++x;、x=x+1;和x=1+x;执行后都使变量x的值增1,请写出一条同一功能的赋值语句(不得与列举相同)___________。

18、表示“整数x的绝对值大于5”时值为“真”的C语言表达式是____________。

19、设y是int型变量,请写出判断y为奇数的关系表达式__________________。

20、若以定义int a=25,b=14,c=19;以下语句的执行结果是_______-。a++<=25&&b--<=2&&c++<=18?printf(“***a=%d,b=%d,c=%d\n”,a,b,c):printf(“###a=%d,b=%d,c=%d\n”,a,b,c);

21、设有以下定义,并以赋予了确定的值:char w; int x; float y; double z;则表达式w*x+z-y所求得值的数据类型为______________。

22、设有int =11;表达式(x++*1/3)的值为___________。

23、设以定义int x=1,y=1;则表达式(!x||y--)的值是____________。

24、若有以下程序段,int c1=1,c2=2,c3; c3=1.0/c2*c1;执行后,变量c3的值为___________-。

25、下列程序的输出结果是16.00,请将程序填写完整。

Main()

{int a=9,b=2;

float x=_________,y=1.1,z;

z=a/2+b*x/y+1/2;

printf(“%5.2f\n”,z);}

26、设x和y均为int型变量,且x=10和y=3则以下语句的输出结果是__________。

Printf(“%d,%d\n”,x++,--y);

27、以下程序的输出结果是______________。

Main()

{int a= -1,b=4; k=(++a<0)&&!(b--<0); printf(“%d %d\n”,k,a,b);}

28、下列程序的输出结果是___________。

Main()

{double d=3.2; int x,y; x=1.2; y=(x+3.8)/5.0; printf(“%f\n”,d*y);}

29、下列程序执行后的输出结果是__________。

Main()

{double d; float f; long l; int j; j=f=l=d=20/3; printf(“%d %d %f %f\n”,j,l,f,d);}

30、下列程序的输出结果是_____________。

Main()

{int a=1,b=2; a+=b; b=a-b; a-=b; printf(“%d,%d\n”,a,b);}

c语言程序设计练习题

第三章 顺序结构

一、选择题

1、下面程序的输出是______

main()

{

int k=11;

printf("k=%d,k=%o,k=%x\n",k,k,k);

}

A) k=11,k=12,k=13

B) k=11,k=13,k=13

C) k=11,k=013,k=oXb

D) k=11,k=13,k=b

2、以下合法的C语言赋值语句是

A)a=b=58 B)k=int(a+b) ; C)a=58,b=58 D)-- i;

3、以下程序的输出结果是

A)0 B)1 C)3 D)不确定

main()

{ int x=10,y=3;

printf(“%d\n”,y=x/y);

}

4、若变量已正确说明为int类型,要给a,b,c输入数据,以下正确的输入语句是

A)read (a,b,c); B)scanf(“%d%d%d”,a,b,c);

C)scanf(“%D%D%D”,%a,%b,%c); D)scanf(“%d%d%d”,&a,&b,&b);

5、执行下面程序段后,c3中的值是_____

A)0 B)1/2 C)0.5 D)1

int c1=1 , c2=2 , c3;

c3=c1/c2;

6、若执行以下程序段,其输出结果是______

A)3,0,-10 B)0,0,3 C)-10,3,-10 D)3,0,3

int a=0 , b=0 , c=0;

c=(a-=a-5) , (a=b,b+3) ;

printf(“%d , %d , %d\n” , a,b,c);

7、以下程序段的输出是_______

A)*0000057.66*

C)*0000057.67*

float a=57.666;

printf(“*%010.2f*\n”, a);

8、若有以下定义和语句:

int a=5

a++;

此处表达式a++的值是____

A) 7 B) 6

C) 5 D) 4

9、若有以下定义和语句:

char c1='b',c2='e';

printf("%d,%c\n",c2-c1,c2-'a'+"A")

则输出结果是_______

A) 2,M B) 3,E

C) 2,e D) 输出结果不确定

10、以下程序的输出结果是______

main() B)* 57.66* D)* 57.67*

{ int x=10,y=10;

printf("%d%d\n",x--,--y);

}

A) 10 10 B) 9 9

C) 9 10 D) 10 9

11、在C语言中,如果下面的变量都是int类型,则输出结果是______

sum=pad=5;

pad=sum++,pad++,++pad;

printf("%d\n",pad);

A) 7 B) 6

C) 5 D) 4

12、以下程序的输出结果_____

#include

main()

{

int i=010,j=10;

printf("%d,%d\n",++i,j--);

}

A) 11,10 B) 9,10

C) 010,9 D) 10,9

13、请读程序

int i =65536

printf("%d\n",i);

上面程序的输出结果是_____

A) 65535 B) 0

C) 有语法错误,无输出结果 D) 1

14、已知字符A的ASCII码为十进制的65,下面程序的输出是_____

main()

{

char ch1,ch2;

ch1='A'+'5'-'3';

ch2='A'+'6'-'3';

printf("%d,%c\n",ch1,ch2);

}

A) 67,D B) B,C

C) C,D D) 不确定的值

15、若有定义和语句:

char s[10]; s="abcd"; printf("%d\n",s);

则结果是_____

A) 输出 abcd B) 输出 a

C) 输出 adcb D) 编译不能通过

16、若有定义:int x,y; char a,b,c; 并有以下输入数据(此处代表换行,代表空格): 1 2

A B C

篇四:第七章习题及答案

第七章 习题

一、选择题(*号题选做)

func( f2(v1,v2)), (v3,v4,v5),(v6,max(v7,v8))); A)3 B)4 C) 5 D)8

(6)以下叙述中错误的是 ( )B

(1)若各选项中所用变量已正确定义,函数fun中通过return语句返回一个函数值,以下选项中错误的程序是A

A)main()

{……x=fun(2,10);……} float fun(int a,int b){……} C)float fun(int,int); main()

{……x=fun(2,10);……} float fun(int a,int b){……} *(2)已定义以下函数 int fun(int *p) {return *p;} fun 函数返回值是B

A)不确定的值 B)一个整数 C)形参p中存放的值 D)形参p的地址值 *(3)若有以下函数首部。

int fun(double x[10],int *n)

A)用户定义的函数中可以没有return 语句

B) 用户定义的函数中可以有多个return语句,以便可以

调用一次返回多个函数值

C) 用户定义的函数中若没有return语句,则应当定义函

数为void类型

B) float fun(int a,int b){……}

main() D)函数的return语句中可以没有表达式 (7)以下关于{……x=fun(i,j);……} return语句的叙述中正确的是B D) main() A) 一个自定义函数中必须有一条return语句

B) 一个自 定义函数中可以根据不同情况设置多条{ float fun(int i,int j); return语句

……x=fun(i,j);……}

C)定义成viod类型的函数中可以有带返回值的return语float fun(int a,int b){……}

D)没有return语句的自定义函数在执行结束时不能返回到调用处

(8)有以下程序

int fun1(double a){return a*=a;} int fun2(double x,double y) {

double a=0,b=0;

a=fun1(x); b=fun1(y); return (int)(a+b); } main()

{double w; w=fun2(1.1,2.0);……} 程序执行后变量w中的值是C A)5.21 B) 5 C) 5.0 D) 0.0

则下面针对此函数的函数声明语句中正确的是( )。D A)int fun(double x,int *n);

B)int fun(double,int);

C)int fun(double *x,int n); D)int fun(double *,int*); (4)若函数调用时的实参为变量时,以下关于函数形参和实参的叙述中正确的是D

A)函数的实参和其对应的形参共占同一存储单元 B)形参只是形式上的存在,不占用具体存储单元 C)同名的实参和形参占同一存储单元

D)函数的形参和实参分别占用不同的存储单元 (5)下面的函数调用语句中func函数的是实参个数是 ( )A

(9)有以下程序: fun(int x,int y){return(x+y);} main()

{int a=1,b=2,c=3,sum;

sum=fun((a++,b++,a+b),c++); printf("%d\n",sum); }

执行后的输出结果是( )。C A)6

B)7

C)8

D)9

(10)有以下程序: void

fun2(char

a,char

b)

{printf("%c,%c",a,b);} char a='A',b='B';

void fun1(){ a='C'; b='D';} main() {fun1();

printf("%c%c",a,b); fun2('E','F'); }

程序的运行结果是( )。A A)CDEF B)ABEF C)ABCD D)

CDAB

*(11)有以下程序 main(int argc,char *argv[]) {int n=0,i; for(i=1;i

编译连接后生成可执行文件tt.exe,若运行时输入以下命令行 tt 12 345 678

程序运行后的输出结果是D

A) 12 B) 12345

C)1

2345678 D) 136

(12)有如下程序: #include void fun(int a,int b) {

int t; t=a;a=b;b=t; } main()

{int c[10]={1,2,3,4,5,6,7,8,9,0},i;

for(i=0;k<10;i+=2)

fun(c[i],c[i+1]);for(i=0;k<10;i++)printf("%d",c[i]);printf("\n"); }

程序的运行结果是A A)1,2,3,4,5,6,7,8,9,0,

B)2,

1,4,3,6,5,8,7,0,9, C)0,9,8,7,6,5,4,3,2,1,

D)0,1,2,3,4,5,6,7,8,9, (13)有以下程序 #include int f(int x,int y) { return ((y-x)*x);} main()

{ int a=3,b=4,c=5,d; d=f(f(a,b),f(a,c)); printf("%d\n",d); }

程序运行后的输出结果是B

A)10

B)9 C)8 D)7

(14)有以下程序 #include int fun(int x,int y) { if(x==y) return (x); else return((x+y)/2); } main()

{ int a=4,b=5,c=6;

printf("%d\n",fun(2*a,fun(b,c))); }

程序运行后的输出结果是B A)3 B)6 C)8

D)12

(15)有以下程序 #include void fun(int p) { int d=2; p=d++; printf("%d",p); } main() { int a=1; fun(a);

printf("%d\n",a); }

程序运行后的输出结果是C A)32 B)12

C)21 D)22

(16)有以下程序 #include<stdio.h> int f(int x); main() {int n=1,m;

m=f(f(f(n)));printf(”%d\n”,m); }

int f(int x) {return x*2;} 程序运行后的输出结果是D A)1 B)2 C)4 D)8 (17)有以下程序 int fun(int n) {

if(n==1) return 1; else

return (n+fun(n-1)); } main() { int x; scanf(“%d”,&x); x=fun(x);

printf(“%d\n”,x); }

程序执行时,给变量x输入10,程序的输出结果是A

(转 载于:wWw.SmHaIDA.cOM 海达 范文 网:a,x-y,b,y-x,c,x-y)

A)55 B) 54 C) 65 D) 45 (18)有以下程序: fun(int x) {int p;

if(x==0||x==1) return(3); p=x-fun(x-2); return p; } main()

{ printf("%d\n",fun(7));} 执行后的输出结果是( )。C A)7

B)3

C)2

D)0

(19)有以下程序 #include int f(int x) {int y;

if(x==0||x==1) return (3); y=x*x-f(x-2); return y; } main() {int z;

z=f(3); printf(“%d\n”,z); }

程序的运行结果是 C A)0 B)9 C)6

D)8 (20)有以下程序 #include int fun(int a, int b) { if(b==0) return a; else return(fun(--a,--b)) ; } main()

{ printf(“%d\n”,fun(4,2); } 程序的运行结果是B A)1 B)2 C) 3 D)4

(21)有以下程序 #include int f(int t [ ],int n); main()

{int a[4]={1,2,3,4},s; s=f{a,4}; printf("%d\n",s); }

int f(int t[], int n)

{ if (n>0) return t[n-1]+f(t,n-1); else return 0; }

程序运行后的输出结果是B A)4 B)10 C)14 D)6 (22)有以下程序 #include<stdio.h> void fun(int x)

{if(x/2>1)fun(x/2); printf(”%d”,x); } main()

{fun(7);printf(”\n”);}

程序运行后的输出结果是D

A)1 3 7 B)7 3 1 C)7 3 D)3 7

(23)有以下程序 int fun(int x[],int n) {static int sum=0,i; for(i=0;i sum+=x[i]; return sum; } main() {int

a[]={1,2,3,4,5},b[]={6,7,8,9},s=0;

s=fun(a,5)+fun(b,4); printf(“%d\n”,s); }

程序执行后的输出结果是C A)45 B)50 C)60 D)55 (24)有以下程序: fun(int x, int y) {static int m=0,i=2;

i+=m+1; m=i+x+y; return m; } main() {int j=1,m=1,k;

k=fun(j,m); printf("%d",k); k=fun(j,m); printf("%d\n",k); }

执行后的输出结果是( )。B A)5,5 B)5,11 C)11,11

D)11,5

(25)有以下程序 int a=4; int f(int n)

{int t=0; static int a=5; if(n%2) {int a=6; t+=a++;} else {int a=7 ; t+=a++;} return t+a++; } main() {int s=a, i=0; for(; i<2; i++) s+=f(i); printf (“%d\n”,s); }

程序运行后的输出结果是B A)24 B)28 C)32 D)36

(26)设函数中有整型变量n,为保证其在未赋初值的情况下初值为0,

应该选择的存储类别是C A)auto B)register C)static

D)auto 或register (27)有以下程序 #include int f(int n); main()

{ int a=3,s;

s=f(a);s=s+f(a);printf("%d\n",s); }

int f(int n) { static int a=1; n+=a++; return n; }

程序运行后的输出结果是C A)7 B)8 C)9 D)10

(28)有以下程序 #include int fun() {static int x=1; x*=2; return x; }

main() {int i,s=1;

for (i=1;i<=2;i++) s=fun(); printf("%d\n",s); }

程序运行后的输出结果是C A)0 B)1 C) 4 D)8 (29)有以下程序 #include<stdio.h> int fun() {static int x=1; x+=1;return x; } main() {int i;s=1;

for(i=1;i<=5;i++)s+=fun();

printf(”%d\n”,s); }

程序运行后的输出结果是B A)11 B)21 C)6 D)120

(30)有以下程序: #include #define N 5 #define M N+1 #define f(x) (x*M) main() { int i1,i2; i1=f(2); i2=f(1+1);

printf("%d %d\n",i1,i2); }

程序的运行结果是( )。B A)12 12 B)11 7 11 11 C)D)

#define S(x) PT*x*x ; main() {

int

a=1,b=2

二 填空题

(1)以下isprime函数的功能是判; 断形参a是否为素数,是素数,函

12 7

(31)若程序中有宏定义行:#define N 100 则以下叙述中正确的是B

A)宏定义行中定义了标识符N的值为整数100

B)在编译程序对C源程序进行预处理时用100替换标识符N

C)对C源程序进行编译时用100替换标识符N

D)在运行时用100替换标识符N (32)以下叙述中错误的是 D A)在程序中凡是以“#”开始的语句行都是预处理命令行

B)预处理命令行的最后不能以分号表示结束

C)#define MAX是合法的宏定义命令行

D)C程序对预处理命令行的处理是在程序执行的过程中进行的 (33)以下关于宏的叙述中正确的是 ( )C

A)宏名必须用大写字母表示 B) 宏定义必须位于源程序中所有语句之前

C) 宏替换没有数据类型限制 D)宏调用比函数调用耗费时间 (34)有以下程序 #include #define PT 3.5 ;

printf("%4.1f\n",S(a+b));} 程序运行后的输出结果是C A)14.0 B)31.5 C)7.5

D)程序有错无输出结果 (35)有以下程序 #include #define f(x) x*x*x main()

{ int a=3,s,t; s=f(a+1);t=f((a+1)); printf("%d,%d\n",s,t); }

程序运行后的输出结果是A A)10,64 B)10,10 C)64,10 D)64,64 (36)以下程序 #include #define SUB(a) (a)-(a) main()

{int a=2,b=3,c=5,d; d=SUB(a+b)*c; printf("%d\n",d); }

程序运行后的结果是C A)0 B)-12 C)-20 D)10

数返回1,否则返回0,请填空 int isprime(int a) { int i;

for(i=2;i<=a/2;i++)

if(a%i==0) __[15]___; //return 0 __[16]___; //return 1 }

(2)以下程序中,函数fun的功能是计算x2-2x+6,主函数中将调用fun函数计算: y1=(x+8)2-2(x+8)+6 y2=sin2

(x)-2sin(x)+6 请填空。 #include "math.h" double

fun(double

x) { return(x*x-2*x+6); } main() {

double x,y1,y2; printf("Enter x:"); scanf("%lf",&x);

y1=fun( 【11】 ); //x+8 y2=fun( 【12】 ); //sin(x) printf("y1=%lf,y2=%lf\n",y1,y2); }

(3)以下程序中函数f的功能是在数组x的n个数(假定n个数互不相同)中找出最大最小数,将其中最小的数与第一个数对换,把最大的数与最后一个数对换.请填空.

篇五:70多项式05x(a-b)-025y(b-a)中

70.多项式0.5x(a-b)-0.25y(b-a)中,可提取的公因式为[ ]

A.0.5x-0.25y; B.0.5x+0.25y;

C.a-b; D.0.25(a-b).

71.在多项式9xyz-6xy2z+3xz2中,可提取的公因式为[ ]

A.xyz; B.3x;

C.3xz; D.3xy.

72.多项式-a(a-x)(x-b)+ab(a-x)(b-x)中,可提取的公因式为

[ ]

A.a(a-x); B.a(x-a)(x-b);

C.(a-x)(x-b); D.-a(x-a).

73.多项式8x3y2-12x2y3-4x2y2,6m2bx2-9m2bxy-3m2bx和-10mx4y2+15mx3y3+5mx3y2的次数最高的公因式是[ ]

A.x; B.xy;

C.x(2x-3y-1); D.mx(2x-3y-1).

74.观察下列多项式:

(1)2a2b+4b2;

(2)(a+b)2x-5x2(a+b)+4(a-b)2;

(3)9a2(x-y)-4b(y-x);

(4)8a3-4a2+2a-1.

其中,可以用提公因式法分解因式的只有[ ]

A.(1),(4); B

C.(2),(4); D

75.(m-n)3-(2n-m)3因式分解为[ ]

A.-3n(m2+3n3-2mn);

B.n(m2+2mn-3n2);

C.(2m-3n)(m2-3mn+3n2);

D.(n-2m)(m2+2mn+3n2).

76.(m-n)3+(2m-3n)3因式分解为[ ]

A.(3m-4n)(3m2+7n2-9mn);

B.(2m-n)(3m2+7n2+9mn);

C.(3m+4n)(3m2+7n2-9mn); .(2),(.(1),(3);3).

D.(3m-4n)(3m+9mn+7n).

77.4m2-n2因式分解为[ ]

A.(2m-n)(2m+n); B.(n-2m)(n+2m); 22

C.(2m-n)2; D

78.144a2-256b2因式分解为[ ]

A.(12a+16b)(12a+16b);

B.(12a-16b)2;

C.(12a-26b)(12a+26b);

D.16(3a-4b)(3a+4b).

79.16x16-y4z4因式分解为[ ]

A.(2x4-yz)(2x4+yz)(4x8+y2z2);

B.(2x2-yz)(2x2+yz)(4x4+y2z2);

C.(4x2-yz)(4x2+yz)(4x4+y2z2);

D.(4x4-yz)(4x4+yz)(x4+y2z2).

80.81x8-225a4b6因式分解为[ ] .(4m-n)(4m+n).

A.(9x-25ab)(9x-25ab);

B.(9x2-25a2b3)(9x4-25a2b3);

C.(9x-15ab)(9x+15ab);

D.(9x4-15a2b3)(9x4+15a2b3).

223443424422

初中作文