#include<stdio.h>
struct tt
{
int x; struct tt *y;
}*p;
struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a};
main()
{
int I;
p=a;
for(i=1;i<=2;i++) printf(“%d”,p->x); p=p->y;
}
程序的运行结果是( )。
A.20,30
B.30,17
C.15,30
D.20,15
[单选题]有以下程序#include <stdio.h>main(){ int x=1,y=0,a=0,b=0;switch(x){ case 1:switch(y){ case 0:a++; break;case 1:b++; break;}case 2:a++; b++; break;case 3:a++; b++;}printf("a=%d,b=%d/n",a,b);}程序的运行结果是A.a=1,b=0B.a=2,b=2C.a=1,b=1D.a=2,b=1
[单选题]有以下程序#include <stdio.h>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);}程序的运行结果是A.0B.9C.6D.8
[单选题]有以下程序:include<stdio.h> include<string.h>main{ char x[]="STRING"有以下程序:include<stdio.h>include<string.h>main{ char x[]="STRING";x[0]=0;x[1]=/0;x[2]=0;printf("%d %d/n",sizeof(x),strlen(x));}程序运行后的输出结果
[单选题]有以下程序#include<stdio.h>#include<string.h>struet A{int a;char b[10];double c;};struct A f(struct A t);main( ){struct A a={1001,“ZhangDa”,1098.0);a=f(A);prinff(“%d,%S,%6.1f\n”,a.a,a.b,a.e);}struct A f(struct A t){t.a=1002;strepy(t.b,“changRo
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char a[10]=”abcd”;prinff(“%d,%d\n”,strlen(A),sizeof(A));}程序运行后的输出结果是A.7,4B.4,10C.8,8D.10,lO
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char str[][20]={“Qne*World”,“one*Dream!”},*P=str[1 ].prinff(“%d,”,strlen(p));printf(“%s\n”,P); ’}程序运行后的输出结果是A.9,One*World S)9,One*Dream!B.10,One*Dream!C.10,One*World
[单选题]有以下程序#include<stdio.h>#include<string.h>main( ){char x[]=“STRING”;x[0]=0;x[1]=’\0’;x[2]=’0’;printf(”%d%d\n”,sizeof(x),strlen(x));}程序运行后的输出结果是( )。A.6 1B.7 0C.6 3D.7 1
[单选题]有以下程序#include<stdio.h>#include<stdlib.h>main( ){int*a,*b,*c;a=b=c=(int*)malloc(sizeof(int));*a=1;*b=2,*c=3;a=bprintf(”%d,%d,%d\n”,*a,*b,*c);}程序运行后的输出结果是( )。A.3,3,3B.2,2,3C.1,2,3D.1,1,3
[单选题]有以下程序#include<stdio.h>#include<string.h>void fun(char *w,int m){ char s,*p1,*p2;p1=w;p2=w+m-1;while(p1<p2){s=*p1;*p1=*p2;*p2=s;p1++;p2--;}}main(){ char a[]="123456";fun(a,strlen(a));puts(a);}程序运行后的输出结果是A.654321B.116611C.161616D.12345
[单选题]有以下程序#include<stdio.h>#include<siring.h>typedef struct{char name[9];char sex;int score [2];}STU;STU f(STU a){ STU b={"Zhao",'m',85,90);int i;strcpy(a.name,b.name);a.sex=b.sex:for(i=0;i<2;i++) a.score [i]=b.score[i];return a;}main()