文档视界 最新最全的文档下载
当前位置:文档视界 › C语言程序设计(第2版)-- 课后题答案.

C语言程序设计(第2版)-- 课后题答案.

C语言程序设计(第2版)-- 课后题答案.
C语言程序设计(第2版)-- 课后题答案.

《C语言程序设计能力教程(第二版)》课后作业及实训题

参考答案

第1章进入C语言程序世界

二、

1. I love China!

printf("we are students.\n")

2. 6

项目实训题参考答案

1.编写一个C程序,输出以下信息:

* * * * * * * * * * * * * * * * * * * *

I am a student!

* * * * * * * * * * * * * * * * * * * *

main()

{ printf("********************\n");

printf(" I am a student!\n ");

printf("********************\n");

}

2.已知立方体的长、宽、高分别是10cm、20cm、15cm,编写程序,求立方体体积。

解:

main()

{

int a,b,c,v;

a=10;

b=20;

c=15;

v=a*b*c;

printf("v=%d",v);

}

本程序运行结果为:

v=3000

第2章编制C程序的基础知识

一选择题

C B A B A C C

二操作题

,2,-8,2

3.000000,2.500000,-8.000000

2. ABC DE

FGH

why is 21+35 equal 52

3.

3 1

4 3

2 3

1 2

4. aa bb cc abc

A N

项目实训题

1.定义一个符号常量M为5和一个变量n值为2,把它们的乘积输出。

#define M 5

main()

{ int n,c;

n=2; c=M*n;

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

2.编程求下面算术表达式的值。

(1)x+a%3*(int)(x+y)%2/4,设x=2.5,a=7,y=4.7;

(2)(float)(a+b)/2+(int)x%(int)y,设a=2,b=3,x=3.5,y=2.5。

(1)main()

{ int a=7;

float x=2.5,y=4.7;

printf("%f\n",x+a%3*(int)(x+y)%2/4); }

(2)main()

{ int a=2,b=3;

float x=3.5,y=2.5;

printf("%f\n",(float)(a+b)/2+(int)x%(int)y); }

第三章顺序结构程序设计

一选择题

A C D C C

二操作题

1. x=3,a=2,b=3

2. z=12.700000

3. 1 2 1

a

2 1 2

三.编程题

编程题

1. 某工种按小时计算工资,每月劳动时间(小时)×每小时工资=总工资,总工资中扣除10%公积金,剩余的为应发工资。编写一个程序从键盘输入劳动时间和每小时工资,打印出应发工资。

解:

#include

main()

{

float sj,gz,yfgz;

printf("time,salary:");

scanf("%f,%f",&sj,&gz);

yfgz=sj*gz*0.9;

printf("total salary:%f\n",yfgz);

}

本程序运行结果为:

time,salary:4,3

total salary:10.800000

2.编写一个程序求出任意一个输入字符的ASCII码

解:

#include

main()

{

char c;

printf("Input a string:");

scanf("%c",&c);

printf("%c ASCII is %d\n",c,c);

}

本程序运行结果为:

Input a string:a

a ASCII is 97

3、编写一个程序用于水果店售货员算帐:已知苹果每斤2.50元,鸭梨每斤1.80

元,香蕉每斤2元,橘子每斤1.6元,要求输入各类水果的重量,打印出应付

解:

main()

{

float p,y,x,j,ys,g,fk;

printf("apple,pear,banana,orange(weight)=");

scanf("%f,%f,%f,%f",&p,&y,&x,&j);

ys=2.5*p+1.8*y+2*x+1.6*j;

printf("fu kuan=");

scanf("%f",&g);

fk=g-ys;

printf("result:\n");

printf("fukuan=%6.2fyuan\nshoukuan=%6.2fyuan\nzhaohui=%6.2fyuan\n",g ,ys,fk);

}

本程序运行结果为:

apple,pear,banana,orange(weight)=1,2,3,4

fu kuan=100

result:

fukuan=100.00yuan

shoukuan= 18.50yuan

zhaohui= 81.50yuan

项目实训

1.假设银行定期存款的年利率rate为2.25%,并已知存款期为n年,存款本金为capital元,试编程计算n年后可得到本利之和deposit。

#include

main()

{ int n;

float rate=0.0225,capital,deposit;

scanf("%d,%f",&n,&capital);

deposit=capital*pow(1+rate,n);

printf("deposit=%f\n",deposit); }

2.将一个三位数整数,正确分离出它的个位、十位和百位数字,并分别在屏幕上输出。

main()

{ int n,a,b,c;

scanf("%3d",&n);

a=n/100;

b=n%100/10;

c=n%100%10/1;

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

第四章选择结构程序设计

一、略

二、B B A B C B A

三、1. 1 0

2. 2 3 2 2

3. 10 20 0

4. ch>=’A’&&ch<=’Z’||ch>=’a’&&ch<=’z’

ch>=’0’&&ch<=’9’

ch==’’

5. -1

四、上机操作

1. 从键盘输入一个英文字母,如果是大写字母,则将它变为小写字母输出;如果是小写字母,则将其变为大写字母输出。

#include

main()

{char ch;

ch=getchar();

if(ch>='A'&&ch<='Z') ch+=32;

else if(ch>='a'&&ch<='z') ch-=32;

putchar(ch);

putchar('\n'); }

2. 根据输入的x值依据下列表达式,计算y的值。

2x (x>-1)

y = 3 (x=-1)

4+x (x<-1)

解:

main()

{

float x,y;

scanf("%f",&x);

y=2*x;

else if(x==1)

y=3;

else y=4+x;

printf("y=%f",y);

}

本程序运行结果为:

-2

y=2.000000

3.编写程序,输入一个整数,判断它是奇数还是偶数,若是奇数,输出“Is Odd“;若是偶数,输出“Is Even“。

main()

{ int x;

scanf("%d",&x);

if(x%2==0) printf("Is Even\n");

else printf("Is Odd\n"); }

4.设计应用程序,求二次方程ax2+bx+c=0的解。

#include

main()

{ float a,b,c,disc,x1,x2,p,q;

scanf("%f,%f,%f",&a,&b,&c);

if(fabs(a)<=1e-6) printf(" The equation is not a quadratic\n");

else

{ disc=b*b-4*a*c;

if(fabs(disc)< 1e-6) printf("x1=x2=%8.4f\n",-b/(2*a));

else if(disc>1e-6)

{x1=(-b+sqrt(disc)/(2*a));

x2=(-b-sqrt(disc)/(2*a));

printf("x1=%8.4f,x2=%8.4f\n",x1,x2); }

else

{ p=-b/(2*a);

q=sqrt(-disc/(2*a));

printf("%8.4f+%x8.4fi\n",p,q);

printf("%8.4f-%8.4fi\n",p,q);} } }

5.按托运规则,行李不超过50公斤时,运费为0.15元/公斤,如超过50公斤,超过部分的运费为0.22元/公斤,现有行李w公斤,编写一个程序计算运费。

解:

#include

main()

{

float w,f,x;

printf("weight:");

scanf("%f",&w);

if(w<=50)

x=0.15*w;

else

x=0.15*50+0.22*(w-50);

printf("money:%6.2f yuan\n",x);

}

本程序运行结果为:

weight:20

money:3.00 yuan

weight:60

money:9.70 yuan

6. 某商场给与顾客购物的折扣率如下:

购物金额<200元不打折

500元>购物金额>=200元 9折

1000元>购物金额>=500元 8折

购物金额>=1000元 7.5折

输入一个购物金额,输出打折率、购物实际付款金额。

#include

main()

{ float x,y,realx;

scanf("%f",&x);

if(x<=0) { printf("Error! You input a worry number!\n"); y=0;} else

{ if(x<200) y=1.0;

else if(x<500) y=0.9;

else if(x<1000) y=0.8;

else y=0.75;}

if(y!=0)

{realx=x*y;

printf("y=%f, the realx=%5.2f\n", y,realx);} }

项目实训

某托儿所收2岁到6岁的孩子,2岁、3岁孩子进小班(Lower class);4岁孩子进中班(Middle class);5岁、6岁孩子进大班(Higher class)。编写程序(用if 语句和switch语句),输入孩子年龄,输出年龄及进入的班号。如:输入:3,输出:age:3,enter Lower class。

#include

main()

{ int age;

printf("Please input your baby's age:");

scanf("%d",&age);

if(age>6||age<2) printf("Sorry,your baby can't enter!");

else switch(age);

{case 2:

case 3: printf("age:%d,enter Lower class\n",age); break;

case 4: printf("age:%d,enter Middle class\n",age);break;

case 5:

case 6: printf("age:%d,enter Higher class",age);break; } }

第五章循环结构程序设计

一、选择题

C C A A

D D

三、操作题

1.求s=1+3+5+7+…100的值。

#include "stdio.h"

main()

{

int i,sum=0;

for(i=1;i<=100;i+=2)

sum=sum+i;

printf("sum=%d",sum);

}

2. 输入班级学生考试成绩,求考试平均成绩。约定当输入负数时,表示输入结束。main()

{ float sum=0,score,ave;

int n=0;

scanf("%f",&score);

while(score>0)

{ n++;

sum=sum+score;

scanf("%f",&score); }

ave=sum/n;

printf("\nThe average score is%.2f",ave); }

3.输入一行字符以@作结束标志,分别统计其中英文字母、空格、数字和其它字符的个数。

#include "stdio.h"

main()

{ char ch;

int cha=0,space=0,digit=0,other=0;

while((ch=getchar())!='@')

{ if (ch>='a'&&ch<='z'||ch>='A'&&ch<='Z') cha++;

else if (ch==' ') space++;

else if (ch>='0'&&ch<='9') digit++;

else other++; }

printf("\ncha=%d,space=%d,digit=%d,other=%d",cha,space,digit,other); } 4.一张纸的厚度为0.1毫米,珠穆琅玛峰的高度为8848.13米,假如纸张有足够大,将纸对折多少次后可以超过珠峰的高度?

main()

{ float h=8848.13,h0=0.0001,h1;

int m=0;

h1=h0;

while(h0<=h)

{ h0=2*h0;

printf("\n m=%d,high=%f",m,h0);

m++; }

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

5、编写一个程序求出满足下列条件的四位数,该数是一个完全平方数;第一、三位

上数之和为10,第二、四位上数之积为12。

解:

#include

main()

{

int i,j,a,b,c,d;

for(i=32;i<=99;i++)

{

j=i*i;

a=j/1000;

b=j/100-a*10;

c=j/10-a*100-b*10;

d=j-a*1000-b*100-c*10;

if(a+c==10&&b*d==12)

printf("%d ",j);

}

}

本程序运行结果为:

1296 9216

6、一个正数与3的和是5的倍数,与3的差是6的倍数,编写一个程序求符合条件

的最小数。

解:

#include

main()

{

int n;

n=1;

while(1)

{

n=n+1;

if((n+3)%5==0&&(n-3)%6==0)break;

}

printf("n=%d",n);

}

本程序运行结果为:

n=27

7、已知xyz+yzz=532,其中x、y、z都是数字,编写一个程序求出x、y、z分别是多

少。

解:

#include

main()

{

int x,y,z,i;

for(x=1;x<=9;x++)

for(y=1;y<=9;y++)

for(z=0;z<=9;z++)

{

i=100*x+10*y+z+100*y+10*z+z;

if(i==532) printf("x=%d,y=%d,z=%d\n",x,y,z);

}

}

本程序运行结果为:

x=3,y=2,z=1

8、学校有近千名学生排队,5人一行余2人,7人一行余3人,3人一行余1人,

求学生人数。

解:

#include

main()

{

int n;

for(n=1000;n>=10;n--)

if(n%5==2&&n%7==3&&n%3==1)break;

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

}

本程序运行结果为:

n=997

9.验证歌德巴赫猜想:任意一个大于6的偶数均可表示为两个质数的和。

#include

main()

{ int i,x;

int p,q,k1,k2;

printf("Please input an odd data(>=6):");

scanf("%d",&x);

for(p=3;p<=x/2;p+=2)

{k1=k2=1;

q=x-p;

if(p>2)

for(i=2;i

if(p%i==0) k1=0;

for(i=2;i

if(q%i==0) k2=0;

if(k1==1&&k2==1) printf("%d=%d+%d\n",x,p,q); }}

10.一个数恰好等于它的平方数的右端,这个数称为同构数。如:5的平方是25,25的平方是625。找出1~1000之间的全部同构数。

#include "math.h"

main()

{ int i,j,k=0;

for (i=2;i<1000;i++)

{ if (i/10==0) j=1; /*因为i是整型,所以是整除*/

else if (i/100==0) j=2;

else if (i/1000==0) j=3;

if ((long int)i*i%(int)pow(10,j)==i) /*同构数的定义*/ { k++; /* 计数器*/

printf("%10d",i);

if (k%5==0) printf("\n"); } }

printf("\nk=%d",k); }

项目实训

1.编写程序求1-1/2+1/3-1/4+…+1/99-1/100的值

#include "stdio.h"

main()

{

int i, s=-1;

float sum=1.0;

for(i=2;i<=100;i++)

sum=sum+1.0*s/i;

printf("sum=%f",sum);

}

2.曾有一位印度国王要奖赏他的聪明能干的宰相达依尔。达依尔只要求在国际象棋的棋盘格上放置小麦粒,第一格放1粒,第二格放两粒,第三格放4粒,第四格放8粒,……,最后能有多少小麦粒呢?

main()

{ float i ,s=1,t=1;

for (i=1;i<=63;i++)

{ t*=2;

s+=t; }

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

3.打印水仙花数,即一个三位数各位上的数字之和等于它本身,如:153=13+53+33。

main()

{int k1,k2,k3,i;

for (k1=1;k1<=9;k1++)

for (k2=0;k2<=9;k2++)

for (k3=0;k3<=9;k3++)

{ i=k1*k1*k1+k2*k2*k2+k3*k3*k3;

if (i==k1*100+k2*10+k3)

printf("\n%d=%d^3+%d^3+%d^3",i,k1,k2,k3); }}

4.编制电视歌手大奖赛评分程序,要求评委人数和每位评委的打分从键盘输入,去掉一个最高分,再去掉一个最低分,求评委给出的最后得分。

main()/* TV大奖赛 */

{int n,i=1;

float x,max,min,sum=0;

printf("\nPlease input the number of score:");

scanf("%d",&n);

printf("\nInput score:");

scanf("%f",&x);

max=x;min=x;sum=x;

while (i

{ i++;

scanf("%f",&x);

sum+=x;

if (max

else if (x

sum=(sum-max-min)/(n-2);

printf("The last score is%8.2f\n",sum);}

5.打印下列图形。

* * * * *

* * * * *

* * * * *

* * * * *

* * * * *

main()

{ int i,j;

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

{ for (j=1;j<=5-i;j++)

printf ( " ");

for (j=1;j<=5;j++)

printf (" *");

printf("\n"); }}

第六章数组

D A D A A C C A D

二、程序阅读题

13 13 13 13 13 13

三、上机实训题

1、分别用冒泡法和选择排序法对十个随机整数进行排序。

参考教材

2、编写一个程序计算字符串中值为x(x由键盘输入)的字符个数。

#include "stdio.h"

#include "string.h"

main()

{ char a[20],x;

int n=0,i=0;

printf("\nPlease input string,end of enter key: ");

gets(a);

printf("\nPlease input x:");

x=getchar();

while(a[i]!='\0')

{if (a[i]==x) n++;

i++; }

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

if(x[i]>ave) printf("%f ",x[i]); }

3、编写一个程序判定用户输入的正数是否为“回文数”,所谓回文数是指数正读反读都相同。

#include

main()

{ int buffer[10],i,k,b;

long number,n;

printf("input a positive number:");

scanf("%ld",&number);

k=0;

n=number;

do

{ buffer[k]=n%10;

k=k+1;

n=n/10; } while(n!=0);

b=1;

for(i=0;i<=(k-1)/2;i++)

if(buffer[i]!=buffer[k-1-i]) b=0;

if(b) printf("%ld is huiwenshu\n",number);

else printf("%ld is not huiwenshu\n",number); }

4、求二维数组的周边元素之和

#include

main()

{

int a[3][3]={{3,-2,1,2},{0,1,3,-2},{3,1,0,4}};

int i,j,sum=0;

for(i=0;i<3;i++)

for(j=0;j<3;j++)

for(i=0;i<3;i++)

if (i==0||j==0||j==2||i==2) sum=sum+a[i][i];

printf("%d",sum);

}

5、编写程序找出一个二维数组的鞍点。即该位置上的元素在该行最大,但是在该列最小。

main()

{ int i,j,k,max,maxi,maxj,flag1,flag2;

int a[2][3]={{1,2,3},{4,5,6}};

flag2=0;

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

{ max=a[i][0];

for (j=0;j<3;j++)

if (a[i][j]>max) { max=a[i][j]; maxj=j;}

for (k=0,flag1=1;k<2 && flag1;k++)

if (a[k][maxj]

if (flag1) {printf("\n %d is answer,locate:line %d colum %d\n",max,i,maxj);

flag2=1; } }

if (!flag2) printf("\n no answer!"); }

项目实训:

1、评定奥运会某参赛选手的成绩。设某参赛选手的某项目有8位评委,要求去掉一个最高分和一个最低分,给出其最后得分。

#include

/*定义字

*/

main()

{

int x[N],i,max,min,score=0;

printf("Please input %d integers:\n",N);

/*输入N个数,存入数组中*/

for(i=0;i

{ scanf("%d",&x[i]); score+=x[i];}

/*赋初值*/

max=min=x[0]; /*将第一个数默认为最大或最小值*/

for(i=1;i

{

if(maxx[i]) min=x[i]; /*求最小值*/ }

printf("The last score is : %d\n",(score-max-min)/(N-2);

}

2、

打印出以下杨辉三角形(要求打印出10行)。

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

…………

#define N 11

main()

{ int i,j,a[N][N];

for (i=1;i

{ a[i][i]=1;a[i][1]=1;}

for (i=3;i

for (j=2;j<=i-1;j++)

a[i][j]=a[i-1][j-1]+a[i-1][j];

for (i=1;i

{ for (j=1;j<=i;j++)

printf("%6d",a[i][j]);

printf("\n"); }

printf("\n"); }

#define N 11

main()

{

int i,j,a[N][N];

for(i=1;i

{

a[i][i]=1;

a[i][1]=1;

}

for(i=3;i

for(j=2;j<=i-1;j++)

a[i][j]=a[i-1][j-1]+a[i-1][j];

for(i=1;i

{

for(j=1;j<=i;j++)

p rintf("%6d",a[i][j]);

printf("\n");

}

printf("\n");

}

本程序的运行结果为:

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1

3、一个程序,将字符数组s2中的全部字符拷贝到字符数组s1中。不用strcpy函数。拷贝时,‘\0’也要拷贝过去。‘\0’后面的字符不拷贝。

解:

#include "stdio.h"

main()

{

char from[80],to[80];

int i;

printf("Input string:");

scanf("%s",from);

for(i=0;i<=strlen(from);i++)

to[i]=from[i];

printf("the result: %s\n",to);

}

本程序的运行结果为:

the result:Input string:student

第七章函数

一、选择题

B D

C B B

D A A D

三、编程题

1、写一个判定偶数的函数,在主函数中输入一个整数,输出是否是偶数的信息。

int even(x)

int x ;

{ if (x%2==0) return(1);

else return(0); }

main()

{ int x;

scanf("%d",&x);

if (even(x)) printf("x is even.");

else printf("x is not even.");}

2、统计 400~499 这些数中 4 这个数字出现的次数,要求判断一个数有几位4这个数字用函数实现。

main()

{ int i,k=0;

for(i=400;i<=499;i++)

k=k+num(i);

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

num(x)

int x;

{ int y,k=0;

while(x!=0)

{ y=x%10;

if(y= = 4) k++;

x=x/10; }

return(k);}

3、找出1000之内的所有“完数”,要求判断一个数是否为完数用函数实现。

main()

{ int i;

for (i=1;i<1000;i++)

if (wan(i)) printf ("%5d",i);

printf ("\n"); }

wan(x)

int x;

{ int i,k;

k=0;

for (i=1;i<=x/2;i++)

if (x%i= =0) k=k+i;

if (k= =x) return (1);

else return (0); }

项目实训:

1、已有变量定义和函数调用语句:int x=57;isprime (x);函数isprime ( )用

来判断一个整型数a是否为素数,若是素数,函数返回1,否则返回0。请编写isprime 函数。

isprime (int a) { }

解:

main()

{ int x=57;

int isprime(int);

if (isprime(x)) printf(“%d is prime.”,x);

else printf(“%d is not prime.”,x);

}

isprime (int a)

{int i;

for(i=2;i

if(a%i= =0) return 0;

return 1;}

2、

输入10个学生的成绩,分别用函数实现:

(1)求平均成绩; (2)按分数高低进行排序并输出。

解:main( )

{float average(float b[]);

void sort(float b[]);

float a[10],j,aver;

printf("input 10:");

for(j=0;j<10;j++)

scanf("%f",&a[j]);

aver=average(a);

printf("aver=%.2f\n",aver);

sort(a);

for(j=0;j<10;j++)

printf("%10.2f",a[j]);

}

float average(float b[ ])

{int j; float sum=0,aver;

for(j=0;j<10;j++)

sum=sum+b[j];

aver=sum/10.0;

return(aver);

}

void sort(float b[ ])

{int i,j,max,k;

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

{max=b[i]; k=i;

f or(j=i+1;j<10;j++)

i f(max

{max=b[j]; k=j;}

b[k]=b[i];

b[i]=max;

}

}

本程序运行结果为:

input 10:45 12 86 85 79 84 85 96 45 89 (输入)

aver=70.60

96.00 89.00 86.00 85.00 85.00 84.00 79.00 45.00 45.00 12.00

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);

新视野大学英语第二册(第二版)课后翻译原题与答案

01. 她连水都不愿喝一口,更别提留下来吃饭了。 She wouldn't take a drink, much less would she stay for dinner. 02. 他认为我在对他说谎,但实际上我讲的是实话。 He thought I was lying to him, whereas I was telling the truth. 03. 这个星期你每天都迟到,对此你怎么解释? How do you account for the fact that you have been late every day this week? 04. 他们利润增长,部分原因是采用了新的市场策略。 The increase in their profits is due partly to their new market strategy. 05. 这样的措施很可能会带来工作效率的提高。 Such measures are likely to result in the improvement of work efficiency. 06. 我们已经在这个项目上投入了大量时间和精力,所以我们只能继续。 We have already poured a lot of time and energy into the project, so we have to carry on. 07. 尽管她是家里的独生女,她父母也从不溺爱她。 Despite the fact that she is the only child in her family, she is never babied by her parents. 08. 迈克没来参加昨晚的聚会,也没给我打电话作任何解释。 Mike didn't come to the party last night, nor did he call me to give an explanation. 09. 坐在他旁边的那个人确实发表过一些小说,但决不是什么大作家。 The person sitting next to him did publish some novels, but he is by no means a great writer. 10. 他对足球不感兴趣,也从不关心谁输谁赢。 He has no interest in football and is indifferent to who wins or loses. 11. 经理需要一个可以信赖的助手,在他外出时,由助手负责处理问题。 The manager needs an assistant that he can count on to take care of problems in his absence. 12. 这是他第一次当着那么多观众演讲。 This is the first time that he has made a speech in the presence of so large an audience. 13. 你再怎么有经验,也得学习新技术。 You are never too experienced to learn new techniques. 14. 还存在一个问题,那就是派谁去带领那里的研究工作。(Use an appositional structure.) There remains one problem, namely, who should be sent to head the research there. 15. 由于文化的不同,他们的关系在开始确实遇到了一些困难。 Their relationship did meet with some difficulty at the beginning because of cultural differences. 16. 虽然他历经沉浮,但我始终相信他总有一天会成功的。 Though he has had ups and downs, I believed all along that he would succeed someday. 17. 我对你的说法的真实性有些保留看法。 I have some reservations about the truth of your claim. 18. 她长得并不特别高,但是她身材瘦,给人一种个子高的错觉。 She isn't particularly tall, but her slim figure gives an illusion of height. 19. 有朋自远方来,不亦乐乎?(Use "it" as the formal subject.) It is a great pleasure to meet friends from afar. 20. 不管黑猫白猫,能抓住老鼠就是好猫。(as long as) It doesn't matter whether the cat is black or white as long as it catches mice. 21. 你必须明天上午十点之前把那笔钱还给我。 You must let me have the money back without fail by ten o'clock tomorrow morning. 22. 请允许我参加这个项目,我对这个项目非常感兴趣。 Allow me to take part in this project: I am more than a little interested in it. 23. 人人都知道他比较特殊:他来去随意。(be free to do sth.) Everyone knows that he is special: He is free to come and go as he pleases. 24. 看她脸上不悦的神色,我似乎觉得她有什么话想跟我说。 Watching the unhappy look on her face, I felt as though she wished to say something to me. 25. 他说话很自信,给我留下了很深的印象。(Use "which" to refer back to an idea or situation.)

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.

C语言程序设计程序填空题库及答案

程序填空题 导读:在程序填空题中,已经给出了程序的主干,读者首先要理解程序的思路,再选择正确的内容填入空白处,使程序完成既定的功能。这类习题的设计就是要引导读者逐步掌握编程的方法。本节习题的难度适中,可能有些典型的程序在课堂上已经有所接触,读者一定要独立完成它,这样就可以逐步提高自己的编程能力。在程序设计语言学习的中期,读者对程序设计已经有了初步的了解,而自己编写程序又不知从何处入手,此时解答此类题目可以避免盲目性,从而提高学习的效率。 【】下面程序的功能是不用第三个变量,实现两个数的对调操作。#include <> main() { int a,b; scanf("%d%d",&a,&b); printf("a=%d,b=%d\n",a,b); a= ①; b= ②; a= ③; printf("a=%d,b=%d\n",a,b); }

【】下面程序的功能是根据近似公式:π2/6≈ 1/12+1/22+1/32+ …… +1/n2,求π值。 #include <> double pi(long n) { double s=; long i; for(i=1;i<=n;i++) s=s+ ①; return( ②); } 【】下面的程序的功能是求一维数组中的最小元素。 findmin(int *s,int t,int *k) { int p; for(p=0,*k=p;p

新视野大学英语4册第二版课后习题答案.doc

新视野大学英语(第2版)第4册Unit 1答案 III. 1. idle 2. justify 3. discount 4. distinct 5. minute 6.accused 7. object 8. contaminate 9. sustain 10. worship IV. 1. accusing... of 2. end up 3. came upon 4. at her worst 5. pa: 6. run a risk of 7. participate in 8. other than 9. object to/objected V 1. K 2. G 3. C 4. E 5. N 6.0 7.1 8. L 9. A 10. D Collocation VI. 1. delay 2. pain 3. hardship 4. suffering 5. fever 6. defeat 7. poverty 8. treatment 9. noise 10. agony Word building VII. 1. justify 2. glorify 3. exemplifies 4. classified 5. purified 6. intensify 7. identify 8. terrified VIII. 1. bravery 2. jewelry 3. delivery 4. machinery 5. robbery 6. nursery 7. scenery 8. discovery sentence Structure IX. 1. other than for funerals and weddings 2. other than to live an independent life 3. other than that they appealed to his eye . . ` 4. but other than that, he'll eat just about everything . 5. other than that it's somewhere in the town center X. 1. shouldn't have been to the cinema last night 2. would have; told him the answer 3. they needn't have gone at all 4. must have had too much work to do 5. might have been injured seriously XIII. 1 .B 2.A 3.C 4.D 5. B 6.A 7.B 8.A 9. C 10.A II.D 12.C 13. D 14.A 15. C 16.D 17.B 18.C I9. A 20.D 新视野大学英语(第2版)第4册Unit 2答案 Section A Comprehension o f the text 1. He lived a poor and miserable life during his childhood. 2. Because no one in Britain appeared to appreciate his talent for comedy. His comic figures did not conform to British standards. 3. Because his dress and behavior didn't seem that English. 4. It was the first movie in which Chaplin spoke. 5. He used his physical senses to invent his art as he went along without a prepared script. 6. His transformation of lifeless objects into other kinds of objects, plus the skill with which he executed it again and again. 7. She brought stability and happiness to him and became a center of calm in his family. 8. Comic. Vocabulary III. 1. coarse 2. betrayed 3. incident 4. postponed 5. execute 6. surrounding 7. applause 8. extraordinary 9. clumsy 10. sparked IV. 1. for 2. against 3. up 4. about 5. up 6. to 7. down 8. down 9. in 10. on V. l. I 2.J 3.B 4.D 5.E 6.G 7.F 8.L 9.N 10.A Collocation
VI. 1. service 2. help/hand 3. influence 4. guarantee 5. visit 6. span . 7. welcome 8. spirit 9. duties 10. buildings Word Building

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"); }

C语言程序设计 复习题库

一、填空 1. break 语句通常用于switch // 循环中。 2. C 语言对数组下标的引用一般从0 开始。 3. C 语言中,一个函数一般由两个部分组成,它们是函数首部和函数体。 4. C 标准库函数中,字符串的处理函数包含在string.h 头文件中,数学函数包含在 math.h 头文件中。 5. C 程序的运行需要经过编译和链接两步进行。 6. C 程序中用/**/ 括起来的内容是程序的注释语句。 7. C 语言函数是由函数首部和函数体两部分组成。其中,函数首部包括函数类型、函数 名和函数参数。 8. C 语言提供的三种逻辑运算符是& ,// ,!。 9. C 语言源程序经过编译后,生成文件的后缀名是.c 。 10. C 语言源程序经过连接后,生成文件的后缀名是.exe 。 11. C 语言中,关系表达式和逻辑表达式的值是1//0 。 12. C 语言中的标识符只能由三种字符组成,他们是字母,数字,下划线。 13. C 语言中的每条基本语句以;作为结束符,每条复合语句以} 作为结束符。 14. C 语言中函数返回值的类型是由函数类型决定的。 15. C 源程序的基本单位是函数。 16. int a = 2, b = 3; 表达式 a > b ? a ++ : ++ b 的值为 4 。 17. int x=1,y=1,z=1; x+=y+=z; 则表达式xb>c 的值是0 。 19. 定义一个指针p,它指向一个有 6 个整型元素的一维数组,定义语句为int *p=a[6] ; 。 20. 定义一个指针数组p ,它有 4 个元素,每个指针指向一个整型数据,定义语句为int *p[4]; 。 21. 赋值语句是由= 加上一个分号构成。 22. 构成数组的各个元素必须具有相同的类型。 23. 关系表达式x+y>5 的相反表达式为x+y !>5 。 24. 函数strlen("1234\0xy") 的值为:9 。 25. 函数的形参在未被调用前不分配空间,函数形参的数据类型要和实参相同。 26. 函数体用{ 开始,用} 结束。 27. 结构化设计中的三种基本结构是顺序,选择,循环。

新视野大学英语册第二版课后习题答案全解

Unit 1答案2版)第4册新视野大学英语(第4. but other than that, he'll eat just about everything . 5. other than that it's somewhere in the town center III. X. 1. idle 2. justify 3. discount 4. distinct 5. minute 1. shouldn't have been to the cinema last night 6.accused 7. object 8. contaminate 9. sustain 10. worship told him the answer 。2. would haveIV. 3. they needn't have gone at all 1. accusing... of 2. end up 3. came upon 4. at her worst 5. pa: 4. must have had too much work to do 6. run a risk of 7. participate in 8. other than 9. object to/objected 5. might have been injured seriously 1. 这种植物只有在培育它的土壤中才能很好地成长。Collocation The plant does not grow well in soils other than the one in which it has been VI. developed. 1. delay 2. pain 3. hardship 4. suffering 5. fever 研究结果表明,无论我们白天做了什么事情,晚上都会做大约两个小时2. 6. defeat 7. poverty 8. treatment 9. noise 10. agony 的梦。Word building Research findings show that we spend about two hours dreaming every night, VII. no matter what we may have done during the day. 1. justify 2. glorify 3. exemplifies 4. classified 有些人往往责怪别人没有尽最大努力,以此来为自己的失败辩护。3. 5. purified 6. intensify 7. identify 8. terrified Some people tend to justify their failure by blaming others for not trying their VIII. best. 1. bravery 2. jewelry 3. delivery 4. machinery 我们忠于我们的承诺:凡是答应做的,我们都会做到。4. 5. robbery 6. nursery 7. scenery 8. discovery We remain true to our commitment: Whatever we promised to do, we would sentence Structure do it. 连贝多芬的父亲都不相信自己儿子日后有一天可能成为世界上最伟大的5. IX. 音乐家。爱迪生也同样如此,他的老师觉得他似乎过于迟钝。1. other than for funerals and weddings Even Beethoven's father discounted the possibility that his son would one day 2. other than to live an independent life become the greatest musician in the world. The same is true of Edison, who 3. other than that they appealed to his eye . . ` 1 / 7 seemed to his teacher to be quite dull. sentence structure 当局控告他们威胁国家安全。6. They were accused by the authorities of threatening the state security. X. 1. it is a wonder to find

(完整版)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语言程序设计第二版 习题参考答案 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. 函数可以带参数,也可以不带参数。

C语言程序设计期末考试试题(含答案)

C语言程序设计 期末考试试题及其答案 一、单项选择题(本大题共20题,每题2 分,共40分) 1、以下不是C语言的特点的是( ) A、C语言简洁、紧凑 B、能够编制出功能复杂的程序 C、C语言可以直接对硬件进行操作 D、C语言移植性好 2、以下不正确的C语言标识符是( ) A、ABC B、abc C、a_bc D、ab.c 3、一个C语言程序是由( ) A、一个主程序和若干子程序组成 B、函数组成 C、若干过程组成 D、若干子程序组成 4、一个算法应该具有“确定性”等5个特性,对另外4个特性的描述中错误的是( ) A、有零个或多个输入 B、有零个或多个输出 C、有穷性 D、可行性 5、设变量a是整型,f是实型,i是双精度型,则表达式10+‘a’+i*f值的数据类型为( ) A、int B、float C、double D、不确定 6、在C语言中,char型数据在内存中的存储形式是( ) A、补码 B、反码 C、源码 D、ASCII码 7、有如下程序,输入数据:12345M678<cR>后(表示回车),x的值是( ) 。 #include main(){ int x; float y; scanf("%3d%f",&x,&y); } A、12345 B、123 C、45 D、345 8、若有以下定义int a,b; float x,则正确的赋值语句是( ) A、a=1,b=2 B、b++; C、a=b=5 D、b=int(x); 9、以下程序的执行结果是( )

#include { int i=10,j=10; printf("%d,%d\n",++i,j--); } A、11,10 B、9,10 C、11,9 D、10,9 10、巳知字母A的ASCII码是65,以下程序的执行结果是( ) #include main() { char c1='A',c2='Y'; printf("%d,%d\n",c1,c2); A、A,Y B、65,65 C、65,90 D、65,89 11、下列运算符中优先级最高的是( ) A、< B、十 C、% D、!= 12、设x、y和z是int型变量,且x=3,y=4,z=5,则下面表达式中值为0是( ) 。 A、’x’&&’y’ B、x<=y C、x||y+z&&y-z D、!((x<y)&&!z ||1) 13、判断char型变量cl是否为小写字母的正确表达式为( ) A、’a’<=c1<=f’z’ B、(c1>=a)&&(c1<=z) C、(‘a’>=c1) (‘z’<=c1) D、(c1>=’a’)&&(c1<=’z’) 14、字符串"a"在内存中占据的字节个数为( ) A、0 B、 1 C、 2 D、 3 15、下面有关for循环的正确描述是( ) A、for循环只能用于循环次数已经确定的情况 B、for循环是先执行循环体语句,后判定表达式 C、在for循环中,不能用break语句跳出循环体 D、for循环体语句中,可以包含多条语句,但要用花括号括起来 16、下面程序的运行结果是( ) #include main() {int num=0; while(num<=2) {num++; printf(“%d ,num); } } A、 1 B、 1 2 C、 1 2 3

新视野大学英语2册课后题答案

新视野大学英语Book II课后练习题答案 Unit 1 Section A Language focus 3.Words in use 1.condense 2.exceed 3.deficit 4.exposure 5.asset 6.adequate https://www.docsj.com/doc/e97157117.html,petent 8.adjusting 9.precisely 10.beneficial 4.Word building Words learned new words formed -al/ial manager managerial editor editorial substantial substance survive survival traditional tradition marginal margin -cy Consistent consistency Accurate accuracy Efficiency efficient -y Recover recovery Minister ministry assemble assembly 5. 1.editorial 2.recovery 3.accuracy 4.substance 5.managerial 6.margin 7.assembly 8.Ministry 9.survival 10.tradition 11.consistency 12.efficient

6.Banked cloze 1.L 2.C 3.J 4.A 5.I 6.O 7.N 8.E 9.H 10.F 7.Expressions in use 1.feel obliged to 2.be serious about 3.run into 4.distinguish between 5.thrust upon 6.was allergic to 7.get lost 8.be attracted to 9.make sense 10.looked upon as 9.Translate the following paragraph into Chinese. 人们普遍认为英语是一种世界语言,经常被许多不以英语为第一语言的国家使用。与其他语言一样,英语也发生了很大的变化。英语的历史可以分为三个主要阶段,古英语,中古英语和现代英语。英语起源于公元5世纪,当时三个日耳曼部落入侵英国,他们对于英语语言的形成起了很大的作用。在中世纪和现代社会初期,英语的影响遍及不列颠群岛。从17世纪初,它的影响力开始在世界各地显现。欧洲几百年的探险和殖民过程导致了英语的重大变化。今天,由于美国电影,电视,音乐,贸易和技术,包括互联网的大受欢迎,美国英语的影响力尤其显著。 10.Translate the following paragraph into English Chinese calligraphy is a unique art and the unique art treasure in the world. The formation and development of the Chinese calligraphy is closely related to the emergence and evolution of Chinese characters. In this long evolutionary process,Chinese characters have not only played an important role in exchanging ideas and transmitting culture but also developed into a unique art form.Calligraphic works well reflect calligraphers’ personal feeling, knowledge, self-cultivation, personality, and so forth, thus there is an e xpression that “seeing the calligraphers’ handwriting is like seeing the person”. As one of the treasures of Chinese culture, Chinese calligraphy shines splendidly in the world’s treasure house of culture and art. Section B 4.words in use 1.mysterious 2.desperate 3.devise 4.negotiate 5.recalled 6.specifically 7.depict 8.ignorance 9.expand 10.confusion 5.Expressions in use

C语言程序设计考试题库

一、判断题 1、所谓常量,就是在程序运行过程中其值可以改变的量。() 2、一个C程序可以由多个源程序文件构成,但其中只能有一个main()函数。() 3、在C语言中do-while 语句和for循环均是先执行循环体语句,再判断表达式。() 4、在函数调用中将变量的地址作为实参传递给对应形参时,实现的是单向的值传递。() 5、C语言中所有字符串都是以‘\0’结束的。() 6、do-while构成的循环语句中的循环体最少执行1次。() 7、数组名在C语言中表示的是数组的首地址。() 8、使用gets()函数输入字符串时可以在字符串中输入空格。() 9、算术运算符中‘/’的优先级高于‘%’。() 10、char a[5];该语句表明数组a中的第五个元素为a[5]。() 11、C语言源程序文件的扩展名均为.c。() 12、char a[5];数组a中有a[1]、a[2]、a[3]、a[4]、a[5]共5个元素。() 13、C语言程序区分大小写,字符常量必须定义为大写。() 14、若int i=10,j=2;则执行i*=j+8;后i的值为28。() 15、若int x=100,y=200;则语句printf("%d",(x,y));输出结果为100。() 16、c语言中的标识符只能由字母,数字和下划线三种字符组成。() 17、函数getchar()的作用是:输出一个字符。() 18、一个C语言程序总是从第一个函数开始执行。() 19、在c语言中,char型数据在内存中是以ASCII码形式存储的。() 20、在C语言中switch语句必须使用break语句。() 二、选择题 1、以下说法正确的是()。 A、C语言程序总是从第一个函数开始执行。 B、C语言程序中要调用的函数必须在main()函数中定义。 C、C语言程序总是从main()函数开始执行。

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