(45) 设有以下定义:
typedef union { long i;int k[5];char c;}DATE;
struct date { int cat;DATE cow;double dog;}too;
DATE max;
则下列语句的执行结果是
printf("%d",sizeof(struct date)+sizeof(max));
A) 25 B) 30 C) 18 D) 8
(46) 执行以下程序后,y的值是
main ( )
{ int a[]={2,4,6,8,10};
int y=1,x,*p;
p=&a[1];
for(x=0;x<3;x++) y + = * (p + x);
printf("%d\n",y); }
A) 17 B) 18 C) 19 D) 20
(47) 下列程序执行后输出的结果是
int d=1;
fun (int q)
{ int d=5;
d + =p + +; printf("%d".d); }
main( )
{ int a=3;
fun(a);
d + = a + +; printf("%d\n",d); }
A) 8 4 B) 9 6 C) 9 4 D) 8 5
(48) 下列程序的输出结果是
main( )
{ char ch[2][5]={"6934,"8254"},*p[2];
int i,j,s=0;
for(i=0;i<2;i + +) p[i]=ch[i];
for(i=0;i<2;i + +)
for(j=0;p[i][j]>’\0’&&p[i][j]<=’9’;j+=2) s=10*s+p[i][j]-’0’;
printf("%d\n",s);
A) 6385 B) 69825 C) 63825 D) 693825
(49) 以下程序的输出结果是
fut (int**s,int p[2][3])
{ **s=p[1][1]; }
main( )
{ int a[2][3]={1,3,5,7,9,11},*p;
p=(int*)malloc(sizeof(int));
fut(&p,a);
primtf("%d\n",*p); }
A) 1 B) 7 C) 9 D) 11
(50) 以下程序的输出结果是
#include"ctype.h"
space (char *str)
{ int i,t;char ts[81];
for(i=0,t=0;str[i]!=’\0’;i+=2)
if(! isspace(*str+i)&&(*(str+i)!=’a’))
ts[t++]=toupper(str[i]);
ts[t]=’\0’;
strcpy(str,ts); }
mian( )
{ char s[81]={"a b c d e f g"};
space(s);
puts(s); }
A) abcdeg B) bcde C) ABCDE D) BCDE