更多"以下程序的输出结果是 #include<stdio.h> stru"的相关试题:
[单项选择]以下程序的输出结果是
#include<stdio.h>
struct st
i int x;int *y;*p;
int dt[4]=10,20,30,40;
struct st aa[4]=50,&dt[0],60,&dt[0],60,&it[0],60,&dt[0],;
main( )
p=aa;
printf("%d/n",++(p->x));
A. 10
B. 11
C. 51
D. 60
[单项选择]
有以下程序
#include
#include
struct A
{ int a; char b[10]; double c;};
void f(struct A t);
main( )
{ struct A a={1001,"ZhangDa",1098.0};
f(a); printf("%d,%s,%6.1f/n",a.a,a.b,a.c);
}
void f(struct A t)
{ t.a=1002; strcpy(t.b,"ChangRong");t.c=1202.0;}
程序运行后的输出结果是()
A. 1001,zhangDa,1098.0
B. 1002,changRong,1202.0
C. 1001,ehangRong,1098.O
D. 1002,ZhangDa,1202.0
[单项选择]以下程序的输出结果是
#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
[单项选择]以下程序的输出结果是( )。
#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
[单项选择]有以下程序:
#include
struct STU
{ int num;
float TotalScore;
};
void f(struct STU p)
{struct STU s[2]={{20044,550},{20045,537}};
p.num=s[1].num; p.TotalScore=s[1].TotalScore;
}
main( )
{ struct STU s[2]= {{20041,703},{20042,580}};
f(s[0]);
printf("%d %3.0f/n",s[0].num,s[0].TotalScore);
}
程序运行后的输出结果是______。
A. 20045 537
B. 20044 550
C. 20042 580
D. 20041 703
[单项选择]以下程序的输出结果是______。
#include<stdio.h>
struct stu
int num;
char name[10];
int age;
;
void fun(struct stu*p)
printf("%s/n",(*p).name);
main( ) struct stu students[3]= 9801,"Zhang",20,
9802,"Wang",19,
9803,"Zhao",18 ;
fun(students+2);
A. Zhang
B. Zhao
C. Wang
D. 18
[单项选择]以下程序的输出结果是( )。
#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
[单项选择]有以下程序
#include<stdlib.h>
struct NODE
int num;struct NODE*next;
main( )
struct NODE *P,*q,*r;
p=(struct NODE *)malloc(sizeof(struct NODE));
q=(struct NODE *)malloc(sizeof(struet NODE));
r=(struct NODE*)malloc(sizeof(struct NODE)):
p->num=10;q->num=20;r->num=30;
p->next=q;q->next=r;
printf("%d/n",p->num+q->next->num):
程序运行后的输出结果是 ( )
A. 10
B. 20
C. 30
D. 40
[单项选择]有以下程序:
#include <stdio.h>
struct S
{ int a, b; } data[2]={10, 100, 20, 200};
main( )
{ struct S p=data[1];
printf("%d/n", ++(p.a));
}
程序运行后的输出结果是______。
A. 10
B. 11
C. 20
D. 21
[单项选择]
有以下程序:
#include <strino.h>
struct STU
{int num;
float TotalScore;};
void f(struct STU p)
{struct STU s[2]={{20044,550},{20045,537}};
p.num=s[1].num;p.TotalScore=s[1].TotalScore;
}
main( )
{struct STU s[2]={{20041,703},{20042,580}};
f(s[0]);
printf("%d%3.0t/n",s[0].num,s[0].TotalScore);
}
程序运行后的输出结果是()。
A. 20045 537
B. 20044 550
C. 20042 580
D. 20041 703
[单项选择]有以下程序:
#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
[单项选择]以下程序的输出结果是( )。
struct st
int x,*y;
*p;
int s[]= 10,20,30,40);
struct st a[]= 1,&s[0],2,&s[1],3,&s[2],4,&s[3];
main( )
p=a;
print("%d/n",++(*(++p)->y));
A. 10
B. 11
C. 20
D. 21
[单项选择]有以下程序:
#include <stdlib.h>
struct NODE
int nurn;
struct NODE *next;
;
main( )
struct NODE *p,*q,*r;
int sum=0;
P=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)malloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=1;q->num=2;r->num=3;
p->next=q;q->next=r;r->next=NULL;
sum+=q->next->num;sum+=p->num;
Printf("%d/n",sum);
执行后的输出结果是( )。
A. 3
B. 4
C. 5
D. 6
[单项选择]有以下程序:
#include <stdio.h>
typedef struct { int b, p; }A;
void f(A c)/* 注意:c是结构变量名*/
{ int j;
c.b+=1; c.p+=2;
}
main( )
{ int i;
A a={1, 2};
f(a);
printf("%d, %d/n", a.b, a.P);
}
程序运行后的输出结果是______。
A. 2, 4
B. 1, 2
C. 1, 4
D. 2, 3
[填空题]有以下程序:
#include <stdio.h>
struct STU
int num;
float TotalScore;;
void f(struct STU p)
struct STU s[2]=20044,550,20045,537;
p.num=s[1].num; p.TotalScore=s[1].TotalScore;
main( )
struct STU s[2]=20041,703,20042,580;
f(s[0]);
printf("%d%3.0f/n",s[0].num, s[0].TotalScore);
程序运行后的输出结果是______。
[单项选择]有以下程序
#include<stdlib.h>
struct NODE
int num;struct NODE*next;;
main( )
struct NODE*p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)malloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20;r->num=30;
p->next=q;q->next=r;
printf("%d/n",p->num+q->next->num);
程序运行后的输出结果是
A. 10
B. 20
C. 30
D. 40
[单项选择]有以下程序:
#include<stdlib.h>
struct NODE
int num;
struct NODE *next;
main( )
struct NODE *p,*q,*r;
int sum=0;
p=(struct NODE *)malloc(sizeof(struct NODE));
q=(Struct NODE *)malloc(sizeof(struct NODE));
r=(Struct NODE *)malloc(sizeof(struct NODE));
p->num=1; q->num=2; r->num=3;
p->next=q; q->next=r; r->next=NULL;
sum+=q->next->num;sum+=p->num;
printf("%d/n",sum);
执行后的输出结果是( )。
A. 3
B. 4
C. 5
D. 6