C语言复习分析运行结果Word文档下载推荐.docx

上传人:b****1 文档编号:5264510 上传时间:2023-05-04 格式:DOCX 页数:32 大小:20.49KB
下载 相关 举报
C语言复习分析运行结果Word文档下载推荐.docx_第1页
第1页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第2页
第2页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第3页
第3页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第4页
第4页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第5页
第5页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第6页
第6页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第7页
第7页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第8页
第8页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第9页
第9页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第10页
第10页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第11页
第11页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第12页
第12页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第13页
第13页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第14页
第14页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第15页
第15页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第16页
第16页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第17页
第17页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第18页
第18页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第19页
第19页 / 共32页
C语言复习分析运行结果Word文档下载推荐.docx_第20页
第20页 / 共32页
亲,该文档总共32页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

C语言复习分析运行结果Word文档下载推荐.docx

《C语言复习分析运行结果Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《C语言复习分析运行结果Word文档下载推荐.docx(32页珍藏版)》请在冰点文库上搜索。

C语言复习分析运行结果Word文档下载推荐.docx

,,8,20,5

下列语句的输出结果是()。

 

main()

{inta,b;

a=32767;

b=a+1;

printf(“%d,%d”,a,b);

,,32767,-32768

以下程序的输出结果为()。

{printf(“*%f,%4.3f*\n”,3.14,3.1415);

,,*3.140000,3.142*

main()

{shorti;

i=-4;

printf(“i:

dec=%d,oct=%o,hex=%x,unsigned=%u”,i,i,i,i);

,,i:

dec=-4,oct=177774,hex=fffc,unsigned=65532

下面程序段的执行结果是()。

inta=3,b=5,x,y;

x=a+1,b+6;

y=(a+1,b+6);

x=%d,y=%d'

x,y);

,,x=4,y=11

已知:

inta=5;

则执行a+=a-=a*a;

语句后,a的值为()。

,,-40

下面程序的运行结果是()。

{floatx=4.9;

inty;

y=(int)x;

x=%f,y=%d'

,,x=4.900000,y=4

以下程序的输出结果是()。

{inta=1,b=2;

a=a+b;

b=a-b;

a=a-b;

printf('

%d,%d\n'

a,b);

,,2,1

}

下列程序的输出结果是()。

{printf(“%3s,%7.2s,%.4s,%-5.3s\n”,“CHINA”,“CHINA”,“CHINA”,“CHINA”);

,,CHINA,︺︺︺︺︺CH,CHIN,CHI︺︺

下列程序段的输出是()。

  

{int 

a=8,b=5;

printf('

%d,'

a%b);

printf('

a*b);

a>

b?

a:

b);

 

,,3,40,8

以下程序的运行结果是()。

main()

{if(2*2==5<

2*2==4)

printf(“T”);

else

printf(“F”);

,,F

{inta,b,c,d,x;

a=c=0;

b=1;

d=20;

if(a)d=d-10;

elseif(!

b)

if(!

c) 

x=15;

else 

x=25;

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

,,20

下列程序的运行结果为()。

{inta=5;

printf(“\n%d,”,(3+5,6+8));

a=(3*5,a+4);

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

,,14,a=9

#include“stdio.h”

main()

{intx=2,y=4,z=40;

x*=3+2;

printf(“%d,”,x);

x=y=z;

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

,,10,40

{inta=5;

printf(“\n%d,”,(3+5,6+8));

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

{inta=5,b=5,y,z;

y=b-->

++a?

++b:

a;

z=++a>

y;

printf(“%d,%d,%d,%d”,a,b,y,z);

,,7,4,6,7

下列程序段的输出结果是()。

%xn'

(0x19<

<

1)&

0x17);

,,12

intk,s;

for(k=0,s=0;

k<

10;

k++)

if(s>

k)break;

elses+=k;

k=%d,s=%d'

k,s);

,,k=4,s=6

.下列程序段的输出是()。

{intk;

for(k=1;

5;

k++){

if(k%2)printf('

*'

);

elsecontinue;

printf('

#'

}

}

,,*#*#

main(_)

inta[10]={1,2,2,3,4,3,4,5,1,5};

intn=0,i,j,c,k;

for(i=0;

i<

10-n;

i++)

{

c=a[i];

for(j=i+1;

j<

j++)

if(a[j]==c)

for(k=j;

k<

k++)

a[k]=a[k+1];

n++;

(10-n);

printf(“%d”,a[i]);

printf(“\n”);

,,12345

当从键盘输入18时,下面程序的运行结果是()。

intx,y,i,a[8],j,u,v;

scanf(“%d”,&

x);

y=x;

i=0;

do{

u=y/2;

a[i]=y%2;

i++;

y=u;

}while(y>

=1);

for(j=i-1;

j>

=0;

j--)

printf(“%d”,a[j]);

,,10010

inti=1,n=3,j,k=3;

inta[5]={1,4,5};

while(i<

=n&

&

k>

a[i])i++;

for(j=n-1;

=i;

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

a[i]=k;

=n;

printf(“%3d”,a[i]);

,,1345

intnum_list[]={6,7,8,9},k,j,b,u=0,m=4,w;

w=m-1;

while(u<

=w)

j=num_list[u];

k=2;

b=1;

while(k<

=j/2&

b=j%++k;

if(b)printf(“%d\n”,num_list[u++]);

num_list[u]=num_list[w];

num_list[w--]=j;

,,7

以下程序的功能是()。

intnum[10]={10,1,-20,-203,-21,2,-2,-2,11,-21};

intsum=0,i;

if(num[i]>

0)

sum=num[i]+sum;

printf(“sum=%6d”,sum);

,,计算数组num中大于零的数据之和

inti,j,row,col,min;

inta[3][4]={{1,2,3,4},{9,8,7,6},{-1,-2,0,5}};

min=a[0][0];

3;

for(j=0;

4;

if(a[i][j]<

MIN)<

P>

{min=a[i][j];

row=i;

col=j;

printf(“min=%d,row=%d,col=%d\n”,min,row,col);

,,in=-2,row=2,col=1

若有以下输入(CR代表回车),则下面程序的运行结果是()。

52CR

inta[8]={6,12,18,42,44,52,67,94};

intlow=0,mid,high=7,found,x;

found=0;

while((low<

=high)&

(found==0))

mid=(low+high)/2;

if(x>

a[mid])low=mdi+1;

elseif(x

{found=1;

break;

if(found==1)printf(“SearchSuccessful!

Theindexis:

%d\n”,mid);

elseprintf(“Can’tsearch!

\n”);

,,SearchSuccessful!

Theindexis:

5

inta[9]={0,6,12,18,42,44,52,67,94};

intx=52,i,n=9,m;

i=n/2+1;

m=n/2;

while(m!

=0)

if(x<

A[I])<

{i=i-m/2-1;

m=m/2;

elseif(x>

a[i])

{i=i+m/2+1;

elsebreak;

printf(“Theindexis:

%d”,i);

,,Theindexis:

6

3245CR

8CR

inti=0,base,n,j,old,num[20];

printf(“Enterdatathatwillbeconverted\n”);

scanf(“%d”,&

n);

old=n;

printf(“Enterbase\n”);

base);

num[i]=n%base;

n=n/base;

}while(n!

=0);

printf(“Thedata%dhasbeenconvertedintothe%d–base

data:

\n”,old,base);

for(j=i;

=1;

printf(“%5d”,num[j]);

,,Thedata3245hasbeenconvertedintothe8-basedata:

62 

inta[10]={1,2,3,4,5,6,7,8,9,10};

intk,s,i;

floatave;

for(k=s=i=0;

if(a[i]%2==0)continue;

s+=a[i];

k++;

if(k!

ave=s/k;

printf(“Thenumberis:

%d.Theaverageis:

%f\n”,k,ave);

,,Thenumberis:

5,Theaverageis:

5.000000

若有以下输入(CR代表回车换行符),则下面程序的运行结果是()。

31232221130CR

inta[4],x,i;

for(i=1;

=3;

i++)a[i]=0;

while(x>

0){a[x]+=1;

i++)printf(“a[%2d]=%4d\n”,i,a[i]);

,,a[1]=3,a[2]=4,a[3]=3

5CR

97531CR

#defineM10

inta[M],x,i,n;

printf(“Entern(n<

10):

”;

scanf(“%d”,a+i);

printf(“Enterx:

”);

a[0]=x;

i=n;

a[i]){a[i+1]=a[i];

i--;

a[i+1]=x;

i++)printf(“%3d”,a[i]);

,,975531

#defineSIZE30

floata[SIZE],b[SIZE/5],sum;

inti,k;

for(k=2,i=0;

SIZE;

I++)<

{a[i]=k;

k+=2;

sum=0;

for(k=0,i=0;

sum+=a[i];

if((i+1)%5==5)

b[k]=sum/5;

printf(“Theresultis:

5;

i++)>

,,Theresultis:

6.00 

16.00 

26.00 

36.00 

46.00 

56.00

字符串“ab\n\\012\\\””的长度是()。

,,9

下面程序段的运行结果是()。

charch[]=“600”;

inta,s=0;

for(a=0;

ch[a]>

=‘0’&

ch[a]<

=‘9’;

a++)

s=10*s+ch[a]-‘0’;

printf(“%d”,s);

,,600

charx[]=“theteacher”;

i=0;

while(x[++i]!

=‘\0’)if(x[i-1]==‘t’)printf(“%c”,x[i]);

he

#include

inti;

chara[]=“Time”,b[]=“Tom”;

a[i]!

=‘\0’&

b[i]!

=‘\0’;

if(a[i]==b[i])

if(a[i]>

=‘a’&

a[i]<

=‘z’)

printf(“%c”,a[i]-32);

elseprintf(“%c”,a[i]+32);

elseprintf(“*”);

,,t*M

chara[2][6]={“Sun”,“Moon”};

inti,j,len[2];

2;

6;

if(a[i][j]==‘\0’)

{len[i]=j;

printf(“%6s:

%d\n”,a[i],len[

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2