第1题
第2题
#include <stdio.h>
void swap(int *a,int *b)
{ int *t;
t=a; a=b; b=t;
}
main()
{ int i=3,j=5,*p=&i,*q=&j;
swap(p,q); printf("%d %d\n",*p,*q);
}
第3题
#include(iostream. h>
void reverse(int a[],int n)
{ int i,t;
for(i=0;;
{t=a[i];a[i]=a[n-1-i];a[n-1-i]=t;}
}
void main()
{ int b[10]={1,2,3,4,5,6,7,8,9,10};int i,s=0;
reverse(b,8);
for(i=6;i <10;i++)s+=b[i];
cout <
}
A.22
B.10
C.34
D.30
第4题
#include<stdio.h>
struct st
{ int x;int *y;}*p;
int dt[4]={10,20,30,40};
struct st aa[4]={50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
main()
{ p=aa;
printf("%d\n",++(p->x));}
A.10
B.11
C.51
D.60
第5题
#include<stdio.h>
struct st
{ int x;int *y;}*p;
int dt[4]={10,20,30,40};
struct st aa[4]={50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
main()
{ p=aa;
printf("%d\n",++(p->x));}
A.10
B.11
C.51
D.60
第6题
#include<stdio.h>
void ast(int x,int y,int*cp,int*dp)
{ *cp=x+y; *dp=x-y; }
main()
{int a=4,b=3,c,d;
ast(a,b,&c,&d);
printf("c=%d,d=%d\n",c,d);
}
第7题
#include <stdio.h>
void fun(char *t,char *s)
{ while(*t!=0) t++;
while((*t++=*s++)!=0);
}
main()
{ char ss[10]="acc",aa[10]="bbxxyy";
fun(ss,aa); printf("%s,%s\n",ss,aa);
}
程序的运行结果是
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
第8题
#include <stdio.h>
void fun(char *t,char *s)
{ while(*t!=0) t++;
while((*t++=*s++)!=0);
}
main()
{ char ss[10]="acc",aa[10]="bbxxyy";
fun(ss,aa); printf("%s,%s\n",ss,aa);
}
程序的运行结果是
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
第9题
A.6,2
B.6,4
C.8,4
D.8,6
第10题
#include <stdio.h>
void fun(char *t,char *s)
{while(*t!=0) t++;
while(*t++=*s++)!=0);
}
main()
{char ss[10]=”acc”,aa[10]=”bbxxyy”;
fun(ss,a
A.; printf(“%s,%s\n”,ss,a
A.;
}
程序的运行结果是( )。
A.accxyy,bbxxyy
B.acc,bbxxyy
C.accxxyy,bbxxyy
D.accbbxxyy,bbxxyy
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!