网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有以下程序段: int a=1,b=2,c=3; struct dent { int n ; int *m; } s[3] = {{101,&a}, {102,&b},{103,&c}}; struct dent *p=s; 则以下表达式中值为2的是()。

A.(p++)->m

B.*(p++)->m

C.(*p).m

D.*((p)->m)


参考答案和解析
B 解析:b+=a;等价于b=b+a;a+=2;等价于a=a+2;b%=10;等价于b=b%10;循环体执行3次。最终,结果为7,1。
更多 “有以下程序段: int a=1,b=2,c=3; struct dent { int n ; int *m; } s[3] = {{101,a}, {102,b},{103,c}}; struct dent *p=s; 则以下表达式中值为2的是()。A.(p++)->mB.*(p++)->mC.(*p).mD.*((p)->m)” 相关考题
考题 有以下程序struct S {int n; int a[20];};void f(struct S *P){ int i,j,t;for(i=0;ip-n-1;i++)for(j=i+1;jp-n;j++)if(p-a[i]p-a[j]) { t=p-a[i]; p-a[i]=p-a[j]; p-a[j]=t; }}main( ){ int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}};f(s);for(i=0;is.n;i++) printf("%d",s.a[i]);}程序运行后的输出结果是A)1,2,3,4,5,6,7,8,9,10,B)10,9,8,7,6,5,4,3,2,1,C)2,3,1,6,8,7,5,4,10,9,D)10,9,8,7,6,1,2,3,4,5,

考题 有以下程序struct S{ int n; int a[20]; };void f(int *a,int n){ int i;for(i=0;in-1;i++) a[i]+=i;}main( ){ int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}};f(s.a,s.n);for(i=0;is.n;i++) printf("%d",s.a[i]);}程序运行后的输出结果是A)2,4,3,9,12,12,11,11,18,9,B)3,4,2,7,9,8,6,5,11,10,C)2,3,1,6,8,7,5,4,10,9,D)1,2,3,6,8,7,5,4,10,9,

考题 有以下程序段struct st{int x;int *y;)*pt;int a[]={l,2},b[]={3,4};struct st c[2]={10,a,20,b};pt=c;以下选项中表达式的值为 11 的是A)*pt-yB)pt-xC)++pt-xD)(pt++)-x

考题 有以下程序struct S {int n; int a[20];}; void f(struct S *P) {int i,j,t; for(i=0;in-1;i++) for(j=i+1;jn;j++) if(p-a[i]p-a[j]) { t=p-a[i]; p-a[i]=p-a[j]; p-a[j]=t; } } main() {int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}}; f(s); for(i=0;i printf(“%d”,s.a[i]); } 程序运行后的输出结果是( )。 A.1,2,3,4,5,6,7,8,9,10,B.10,9,8,7,6,5,4,3,2,1,C.2,3,1,6,8,7,5,4,10,9,D.10,9,8,7,6,1,2,3,4,5,

考题 有以下程序struct S{ int n; int a[20]; }; void f(int *a,int n) {int i; for(i=0;i a[i]+=i; } main() {int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}}; f(s.a, s.n); for(i=0;i printf(“%d”,s.a[i]); } 程序运行后的输出结果是( )。A.2,4,3,9,12,12,11,11,18,9,B.3,4,2,7,9,8,6,5,11,10,C.2,3,1,6,8,7,5,4,10,9,D.1,2,3,6,8,7,5,4,10,9,

考题 有以下程序: struct S{int n;int a[20];}; void f(int*a,int n) {int i; for(i=0;i<n-1;i++)a[i]+=i;} mainf() {int i;struct S s{10,{2,3,1,6,8,7,5,4,10,9}}; if(s.a,s.n); for(i=0;i<s.n;i++)printf("%d",s.a[i]);} 程序运行后的输出结果是( )。A.2,4,3,9,12,12,11,11,18,9B.3,4,2,7,9,8,6,5,11,10C.2,3,1,6,8,7,5,4,10,9D.1,2,3,6,8,7,5,4,10,9

考题 有以下程序 struct S{ int n;int a[20];}; voidf(struct S*p) { int i,j,t; for(i=0;i<p->n-1;i++) for(j=i+1;j<p->n;j++) if(p->a[i]>p->a[j]){t=p->a[i];p->a[i]=p->a[j];p->a[j]=t;} } main() { int i;struct S s={10,{2,3,l,6,8,7,5,4,10,9}}; f(s); for(i=0;i<s.n;i++)printf("%d,",s.a[i]); } 程序运行后的输出结果是A.1,2,3,4,5,6,7,8,9,10,B.10,9,8,7,6,5,4,3,2,1,C.2,3,1,6,8,7,5,4,10,9,D.10,9,8,7,6,1,2,3,4,5,

考题 有以下程序段: struct st{int x; int *y; } *pt;int a[]={1,2}, b[]={3,4};struct st c[2]={10,a,20,b};pt=c; 以下选项中表达式的值为11的是( )。A.*pt->yB.pt->xC.++pt->xD.(pt++)->x

考题 下列程序的输出结果是( ) struct abc { int a,b,c;}; main() { struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t); }A.3B.4C.5D.6

考题 下列程序的输出结果是()。includestruct abc{int a, b, c, s;};main(){struct abc s[2] 下列程序的输出结果是( )。 #include <stdio.h> struct abc { int a, b, c, s;}; main() { struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t); }A.5B.6C.7D.8

考题 下列程序的输出结果是______。 struct abc { int a,b,c;}; main () { struct abc s[2]={{1,2,3},{4,5,6}}; int t;t=s[0].a+s[1].b; printf("%d\n",t); }A.5B.6C.7D.8

考题 有以下程序: include struct STU {int num; float TotalScore; 有以下程序: #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 537B.20044 550C.20042 580D.20041 703

考题 有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 若有以下程序段: struct st {int n; int*m: }; int a=2,b=3,c=5; struct st s[3]=({101,a},{102,c},{103,B)}; main() {struct st*p; p=s; } 则以下表达式中值为5的是( )。A.(*p).mB.*(p+1)->mC.*(p++)->nD.(p++)(*m)

考题 设有以下程序段:struct st{int n;struct st *next;};static struct st a[3]={5,a[1],7,a[2],9,'\0'),*p;p=a[0];下面选项中,其值为6的表达式为______。A.P++->nB.p->n++C.(*p).n++D.++p->n

考题 以下程序运行后的输出结果是【 】。struct NODE{int num;struct NODE *next;};main(){struct NODE s[3]={{1,'\0'},{2,'\0'},{3,'0'}},*p,*q,*r;int sum=0;s[0].next=s+1;s[1].next=s+2;s[2].next=s;p=s; q=p->next; r=q->next;sum+=q->next->num; sum+=r->next->next->num;printf("%d\n",sum);}

考题 有如下程序段struct abc{ int a, b, c, s;};main(){ struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t);}程序运行后输出的结果是A.5 B.6 C.7 D.8

考题 若有以下程序段: struct st {int n; int*m;}; int a=2,b=3,c=5; struct st s[3]=({101,a},{102,c},{103,b}}; main() {struct st*p; p=s; …} 则以下表达式中值为5的是( )。A.(p++)->mB.*(p++)->mC.(*p).mD.*(++p)->m

考题 设有以下程序: struct st{int n;struct st *next;}; static struct st a[3]={5,a[1],7,struct st *next;}; static struct st a[3]={5,a[1],7,a[2],9,'\0'},*p; p=a [0]; 下面选项中,表达式值为6的是______。A.p++->nB.p->n++C.(*p).n++D.++p->n

考题 若有以下定义和语句 struct a{ int n,m;}; struct a st[3]={{2,3},{4,5},{6,7}}; struct a*p=st;则以下错误的引用是A.(p++)-n; B.st[0].n; C.(*p).n; D.P=st.m,

考题 有以下程序:struct S{int n;int a[20];};void f(struct S*P){int i,j,t;for(i=0;in-1;i++)fo 有以下程序: struct S{int n;int a[20];}; void f(struct S*P) { int i,j,t; for(i=0;i<P->n-1;i++) for(j=j+1;j<P->n-1;j++) if(p->a[i]>p->a[j]) {t=P->a[i];p->a[i]=P->a[j];p->a[j]=t} } main() {int i;struct S s{10,{2,3,1,6,8,7,5,4,10,9}}; f(&s); for(i=0;i<s.n;i++)printf("%d",s.a[i]);} 程序运行后的输出结果是( )。A.3B.4C.5D.6

考题 设有以下程序: struct st{int n;struct st*next;}; static struct st a[3]={5,a[1],7,a[2],9,'\0\},*p; p=a[0];下面其值为6的表达式为______。A.p++->nB.p->n++C.(*p).n++D.++p->n

考题 有以下程序: #includestdio.h struct stu { int num; char name[10]: int age;} void fun(struct stu*p) {printf("%s\n",(*p).name);} the main { struct stu students[3]={{9801,"Zhang".20}, {9802,"Wang",19},{9803,"Zhao",1 8}} fun(students+2); } 输出的结果是( )。A. ZhangB.ZhaoC.WangD.18

考题 以下程序的输出结果是______。includestruct stu{int num; char name[10]; int age;};v 以下程序的输出结果是______。#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.ZhangB.ZhaoC.WangD.18

考题 若有以下定义和语句 struct a { int n,m;}; struct a st[3]={{1,20},{2,19},{3,21}}; struct a*p=st; 则以下错误的引用是A.(p++)->n;B.st[0].n;C.(*p).n;D.p=st.m;

考题 单选题有以下程序#include struct S{ int n; int a[20];};void f(struct S *p){ int i,j,t; for(i=0;in-1;i++)  for(j=i+1;jn;j++)   if(p-a[i]p-a[j])   {    t=p-a[i];    p-a[i]=p-a[j];    p-a[j]=t;   }}main(){ int i; struct S s = {10,{2,3,1,6,8,7,5,4,10,9}}; f(s); for(i=0;i A 1,2,3,4,5,6,7,8,9,10,B 10,9,8,7,6,5,4,3,2,1,C 2,3,1,6,8,7,5,4,10,9,D 10,9,8,7,6,1,2,3,4,5,

考题 单选题若有以下程序段struct st{ int n; struct st*next;};struct st a[3] = {5,a[1],7,a[2],9,'\0'}, *p;p = a[0];则以下选项中值为6的表达式是(  )。A p-n++B (*p).nC ++(p-n)D p-n

考题 单选题有以下程序段struct st{ int x; int *y;}*pt;int a[]={1,2},b[]={3,4};struct st c[2]={10,a,20,b};pt=c;以下选项中表达式的值为11的是(  )。A ++pt-xB pt-xC *pt-yD (pt++)-x