网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
( 37 )有以下程序
#include <stdio.h>
#include <string.h>
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
参考答案
更多 “ ( 37 )有以下程序#include stdio.h#include string.hstruct 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.0B ) 1002,changRong,1202.0C ) 1001,ehangRong,1098.OD ) 1002,ZhangDa,1202.0 ” 相关考题
考题
下列程序的运行结果为【14】#include stdio.h#include string.hstruct 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,if\n”,a.a,a.b,a.c);}void f(struct A *t){strcpy(t-b,”ChangRong”); }
考题
下列程序的运行结果为【 1 4 】#include stdio.h#include string.hstruct 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){ strcpy(t-b,"ChangRong");}
考题
有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s
有以下程序 #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]={{"YangSan",20041},{"LiSiGuo",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
考题
有以下程序 include typedef struct { int num;double s; }REC; void funl(REC *x) { x
有以下程序 include<stdio.h> typedef struct { int num;double s; }REC; void funl(REC *x) { x->num=23;x->s=88.5; } void main() { REC a={16,90.0}; fun1(A); printf("%d\n",a.num); } 程序运行后的输出结果是( )。
考题
有以下程序 struc t STU{ char name [10] int num; void f1(struct STU c) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main ( ) { struct STU a={"YangSan",2041},b={"WangYin",2043}; f1 (a); f2 (b); printf ( "%d %d\n" ,a.num,b.num); } 执行后输出结果是A.2041 2044B.2041 2043C.2042 2044D.2042 2043
考题
有以下程序: struct STU { char name[10]; int num; float TotalScore; }; void f(struct STU *p) { struct STU s[2]={{"SunDan", 20044, 550}, {"Penghua", 20045, 537}}, *q=s; ++p; ++q; *p=*q; } main() { struct STU s[3]={{"YangSan", 20041, 703}, {"LiSiGuo", 20042, 580}}; f(s); printf(" % s % d % 3.0f\n", s[1]. name, s[1]. num, s[1]. TotalScore); } 程序运行后的输出结果是______。A.SunDan 20044 580B.Penghua 20045 537C.LiSiGUO 20042 580D.SunDan 20041 703
考题
有以下程序#inculde stdio.h#inculde string.hstrtict 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.B,a.c);void F(struct A t){ t.a=1002;strcpy(t.B,”ChangRong”);t.c=1202.0;}程序运行后的输出结果是A.1001,zhangDa,1098.0B.1002,ChangRong,1202.0C.1001,ChangRong,10980D.1002,zhangDa,1202.0
考题
有以下程序: 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
考题
下列程序的运行结果为【】。 include include {int a; char b[10]; double c;};
下列程序的运行结果为【 】。include<stdio.h>include<string.h>{ 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.lf\n",a.a,a.b,a.C);}void f(struct A*t){ strcpy(t->b, "ChangRong");}
考题
有以下程序#include string.hstruct STU{ int num; float TotalScore; };void f(struct STU p){ struct STU s[2]={{1047,530},{1048,531}}; p.num = s[1].num; p.TotalScore = s[1].TotalScore;}main(){ struct STU s[2]={{2041,730},{2042,731}}; f(s[0]); printf("%d,%3.0f\n",s[0].num,s[0].TotalScore);}程序的运行结果是A.1047,530 B.1048,531C.2041,730 D.2042,731
考题
有以下程序struc STU {char name[10];int num; };void f1(struct STU c){ struct STU b={“LiSiGuo”,2042};c=b; }void f2(struct STU *c){ struct STU b={“SunDan”,2044};*c=b; }main( ){ struct STU a={“YangSan”,2041},b={“WangYin”,2043 };f1(a);f2(b);printf(“%d %d\n”,a.num,b.num); }执行后的输出结果是( )A.2041 2044B.2041 2043C.2042 2044D.2042 2043
考题
有以下程序#includestdio.h#includestring.hstruet 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,“changRong”);t.c=1202.O;return t;}程序运行后的输出结果是A.1001,ZhangDa,1098.0B.1002,ZhangDa,1202.0C.1001,ChangRong,1098.0D.1002,ChangRong,1202.0
考题
有以下程序: #includestdi0.h #includestring.h struct A {int a;char b[10];double C;); void f(struct A t); main( ) {struct A a={"1001,"ZhangDa",l098,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,"ChangRon9");t.c=1202.0;} 程序运行后的输出结果是( )。A.1001,ZhangDa,1098.0B.1002,ChangRong,1202.0C.1001,ChangRong,1098.0D.1002,ZhangDa,1202.0
考题
有以下程序: #includestdio.h #includestring.h struct A {int a;char b[10];double C;); struct A f(struct A t): main( ) {struct A a={1001,"ZhangDa",l098.0}; a=f(a);printf("%d,%S,%6.1f\n",a.a,a.b,a.c); } struct A f(struct A t) {t.a= 1002;strcpy(t.b,"ChangRon9");t.c=1202.0;return t;} 程序运行后的输出结果是( )。A.1001,ZhangDa,1098.0B.1002,ZhangDa,1202.0C.1001,ChangRong,1098.0D.1002,ChangRong,1202.0
考题
有以下程序: struct STU{ char name[10]; int num; }; void f1(struct STU c) { struct STU b={"LiSiGuo",2042); c=b; } void f2(struct STU *c) { struct STU b={"SunDan",2044); *c=b; } main() {struct STU a={"YangSan",2041},b={"WangYin",2043); f1(a);f2(b); printf("%d %d\n",a.num,b.num); } 执行后输出结果是( )。A.2041 2044B.2041 2043C.2042 2044D.2042 2043
考题
有以下程序: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
考题
有以下程序: include include void f(char * s,char*t){char k; k=*s;*s=*
有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg
考题
有以下程序:include struct STU{char name[10]; int num;};void f1(struct STU c){ st
有以下程序: #include <stdio.h> struct STU { char name[10]; int num; }; void f1(struct STU c) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU *c) { struct STU b={"SanDan",2044}; *c=b; } main() { struct STU a={"YangSan",2041}, b={"WangYin",2043}; f1(a); f2(b); printf("%d%d\n",a.num,b.hum); } 执行后的输出结果是( )。A.2041 2044B.2041 2043C.2042 2044D.2042 2043
考题
有以下程序:includeinclude struct STU {char name[10];int hum;};void f(
有以下程序:#include <stdio.h>#include <strine.h> struct STU { char name[10]; int hum;};void f(char * name,iht num){ struct STU s[2] = {{ "SunDan" ,20044} , {" Penghua" ,20045}}; num= s[0]. nnm; strepy(name,s[0], name);}main( ){ struct STU s[2] = {{"YangSan" ,20041 }, { "LiSiGao" ,20042}}, * P; p = s[1]; f(p->name,p->hum); printf("% s %d \n" ,p-> name,p->num);}程序运行后的输出结果是( )。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041
考题
有以下程序 struct STU{ char name[10]; int num; }; void f1(struct STU C) { struct STU b={"LiSiGuo",2042}; c=b; } void f2(struct STU*C) { struct STU b={"SunDan",2044}; *c=b; } main() { struct STU a={"YangSan",2041},b={"Wang Yin",2043}; f1(a) ;f2(b) ; printf("%d%d\n",a.num,b.num); } 执行后输出结果是A.2041 2044B.2041 2043C.2042 2044D.2042 2043
考题
( 37 )有以下程序#include stdio.h#include string.hstruct 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.0B ) 1002,changRong,1202.0C ) 1001,ehangRong,1098.OD ) 1002,ZhangDa,1202.0
考题
单选题有以下程序:#include #include typedef struct{ char name[10]; char sex; int age;}STU;void fun(STU t){ strcpy(t.name,Tong); t.age++;}main(){ STU s[2] = {Hua, 'm', 18, Qin, 'f', 19}; fun(s[1]); printf(%s,%d,%s,%d, s[0].name, s[0].age, s[1].name, s[1].age);}程序运行后的输出结果是( )。A
Hua,19,Tong,19B
Hua,18,Tong,20C
Tong,19,Qin,19D
Hua,19,Tong,19
考题
单选题有如下程序:#include #include struct S{ char name[10];};void change(struct S *data,int value){ strcpy(data-name, ****); value=13;}main(){ struct S input; int num = 4; strcpy(input.name, THIS); change(input,num); printf(%s,%d,input.name,num);}程序运行后的输出结果是( )。A
****,4B
****,13C
THIS,4D
THIS,13
考题
单选题若有以下程序#include #include #include typedef struct stu{ char *name,gender; int score;}STU;void f(char *p){ p=(char *)malloc(10); strcpy(p,Qian);}main(){ STU a={NULL,'m',290},b; a.name=(char *)malloc(10); strcpy(a.name,Zhao); b=a; f(b.name); b.gender='f'; b.score=350; printf(%s,%c,%d,, a.name, a.gender, a.score); printf(%s,%c,%d, b.name, b.gender, b.score);}则程序的输出结果是( )。A
Qian,m,290,Qian,f,350B
Zhao,m,290,Qian,f,350C
Qian,f,350,Qian,t,350D
Zhao,m,290,Zhao,f,350
考题
单选题有以下程序:#include #include struct 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); printf(%d,%s,%6.1f,a.a,a.b,a.c);}struct A f(struct A t){ t.a=1002; strcpy(t.b,ChangRong); t.c=1202.0; return t;}程序运行后的输出结果是( )。A
1001,ZhangDa,1098.0B
1002,ZhangDa,1202.0C
1001,ChangRong,1098.0D
1002,ChangRong,1202.0
考题
单选题有以下程序#include #include struct S{ char name[10];};void change(struct S *data, int value){ strcpy(data-name, #); value = 6;}main(){ struct S input; int num = 3; strcpy(input.name, OK); change(input, num); printf(%s,%d, input.name, num);}程序运行后的输出结果是( )。A
OK,6B
#,6C
OK,3D
#,3
考题
单选题有以下程序:#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,a.a,a.b,a.c);}void f(struct A t){ t.a=1002; strcpy(t.b,ChangRong); t.c=1202.0; return t;}程序运行后的输出结果是( )。A
1001,ZhangDa,1098.0B
1002,ChangRong,1202.0C
1001,ChangRong,1098.0D
1002,ZhangDa,1202.0
热门标签
最新试卷