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

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

有以下程序

#include<stdio.h>

#include<string.h>

typedef struct {char name[9]; char sex; float score[2];}STU;

STU f(STU

A.

{

STU b={“Zhao”,’m’,85.0,90.0}; int I;

strcpy(a.name,b.name);

a.sex=b.sex;

for(i=0;i<2;i++) a.score=b.score;

return a;

}

main()

{

STU c={“Qian”,’f’,95.0,92.0},d;

d=f(

C.;

printf(“%s,%c,%2.0f,%2.0f\n”,d.name,d.sex,d.score[0], d.score[1]);

}

程序的运行结果是( )。

A. Qian,f,95,92

B.Qian,m,85,90

C.Zhao,m,85,90

D.Zhao,f,95,92


参考答案

更多 “ 有以下程序#includestdio.h#includestring.htypedef struct {char name[9]; char sex; float score[2];}STU;STU f(STUA.{STU b={“Zhao”,’m’,85.0,90.0}; int I;strcpy(a.name,b.name);a.sex=b.sex;for(i=0;i2;i++) a.score=b.score;return a;}main(){STU c={“Qian”,’f’,95.0,92.0},d;d=f(C.;printf(“%s,%c,%2.0f,%2.0f\n”,d.name,d.sex,d.score[0], d.score[1]);}程序的运行结果是( )。A. Qian,f,95,92B.Qian,m,85,90C.Zhao,m,85,90D.Zhao,f,95,92 ” 相关考题
考题 设有以下说明语句typedefstruct{intn;charch[8];}PER;则下面叙述中的是()。 A、PER是结构体变量名B、PER是结构体类型名C、typedefstruct是结构体类型D、struct是结构体类型名

考题 有以下程序:includemain(){int y=9;for(;y>0;y--)f(y%3==0)printf("%d",--y);}程序的 有以下程序: #include<stdio.h> main() { int y=9; for(;y>0;y--) f(y%3==0)printf("%d",--y); } 程序的运行结果是( )。A.741B.963C.852D.875421

考题 有下列程序:#includestdi0.h#include”strin9.h”typedefstruct{charname[9];charsex;floatscore[2];}STU;voidf(STUa){STUb={Zha0,m,85.0,90.0);inti;strcpy(a.name,b.name);sex=b.sex;for(i=0;i2;i++)a.score[i]=b.score[i];}voidmain( ){STUc={Qian,f,95.0,92.0);f(c);printf(%s,%c,%2.Of,%2.Of\n,C.name,C.sex,score[O],C.score[1]);}程序的运行结果是( )。A.Qian,f,95,92B.Qian,m,85,90C.Zha0,f,95,92D.Zha0,m,85,90

考题 有下列程序:#includestdi0.hvoidmain( ){stuctSTU{charname[9];charsex;doublescore[2];};stuctSTUa={Zha0,m,85.0,90.0),b={Qian,f,95.0,92.0};b=a:printf(%S,%C,%2.0,%2.0\n”,b.name,b.sex,score[O],bscore[1]);程序的运行结果是( )。A.Qian,f,95,92B.Oian,m,85,90C.Zha0,f,95,92D.Zha0,m,85,90

考题 有以下程序:include struet STU{charname[10]; int num; float TotalSeore; };void f( 有以下程序:#include <stdio.h>struet STU{ charname[10]; int num; float TotalSeore; };void f(struet STU * p){ struet 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.Of\n" ,s [1]. name, s [1]. num ,s [1]. TotalScore);}程序运行后的输出结果是( )。A.SunDan 20044 550B.Penghua 20045 537C.LiSiGuo 20042 580D.SunDan 20041 703

考题 有以下程序:include main(){inty=9;for( ; y>0; y--)if(y%3==0) printf("%d", --y);} 有以下程序: #include <stdio.h> main() {int y=9; for( ; y>0; y--) if(y%3==0) printf("%d", --y); } 程序的运行结果是( )。A.741B.963C.852D.875421

考题 有以下程序 include main() { int y=9; for( ; y>0; y--) if(y% 有以下程序 #include <stdio.h> main() { int y=9; for( ; y>0; y--) if(y%3==0) printf("%d",--y); } 程序的运行结果是A.741B.963C.852D.875421

考题 有以下程序includemain(){int y=9;for(;y>0;y--)if(y%3==0)printf("%d",--y);}程序的 有以下程序 #include<stdio.h> main() {int y=9; for(;y>0;y--) if(y%3==0)printf("%d",--y); } 程序的运行结粜是( )。A.741B.963C.852D.875421

考题 有以下程序: 程序的运行结果是( )。 A.1 2 3 4B.5 6 7 8C.9 10 11 12S 有以下程序:程序的运行结果是( )。A.1 2 3 4B.5 6 7 8C.9 10 11 12D.1 1 1 1

考题 有以下程序:程序运行后的输出结果是( )。A.7B.8C.9D.10

考题 有以下程序:A.1,5,9,B.1,4,7,C.3,5,7,D.3,6,9,

考题 有以下程序程序的运行结果是( )。A.1,2,3,4,5,6,7,8,9,0,B.2,1,4,3,6,5,8,7,0,9,SXB 有以下程序程序的运行结果是( )。A.1,2,3,4,5,6,7,8,9,0,B.2,1,4,3,6,5,8,7,0,9,C.0,9,8,7,6,5,4,3,2,l,D.0,1,2,3,4,5,6,7,8,9,

考题 有以下程序:A.9B.61490C.61D.5

考题 有以下程序段:A.9B.1C.11D.10

考题 有以下程序段:A.B.C.D.9A.AB.BC.CD.D

考题 下列给定程序中,函数fun的功能是:将形参n中个位上为偶数的数取出,并按原来从高位到低位相反的顺序组成一个新数,作为函数值返回。例如,输入一个整数27638496,函数返回值为64862。请在程序的下划线处填入正确的内容并将下划线删除,使程序得出正确的结果。注意:部分源程序在文件BLANKl.C中。不得增行或删行,也不得更改程序的结构!include&lt;stdi0.h&gt;unsigned long fun(unsigned long n){unsigned long x=0;int t;

考题 有以下程序:程序运行后的输出结果是( )。A.10,One*Dream!B.9,One*Dream!C.9,One*WorldD.10,One*World

考题 有如下程序: #includeiostream usingnamespacestd; className{ charname[20]; public: Name( ){ strcpy(name,"");cout?; } Name(char*fname){ strcpy(name,fname);cout?; } }; intmain( ){ Namenames[3]={Name(”张三”),Name(”李四”)); return0; } 运行此程序输出符号?的个数是( )。A.OB.1C.2D.3

考题 下列给定程序中,函数fun的功能是:从低位开始依次取出长整型变量s中奇数位上的数,构成一个新数存放在t中。高位仍在高位,低位仍在低位。例如,当s中的数为7654321时,t中的数为7531。请改正程序中的错误,使它能得出正确的结果。注意:部分源程序在文件MODll.C中,不得增行或删行,也不得更改程序的结构!include&lt;stdi0.h&gt;

考题 有以下程序:程序运行后的输出结果是( )。A.3B.4C.lD.9

考题 有以下程序:includevoid main(){int x=10,y=10;for(int i=0;x>8;y=++i)cout 有以下程序: #include<iostream.h> void main() { int x=10,y=10; for(int i=0;x>8;y=++i) cout<<x--<<","<<y<<","; } 该程序运行后的输出结果是( )。A.10,1,9,2B.9,8,7,6C.10,9,9,0D.10,10,9,1

考题 有以下程序:程序的运行结果是( )。A.0B.9C.6D.8

考题 有以下程序 main() {int x=10,y=10;printf("%d%d\n",x--,--y);} 程序运行后的输出结果是( )A.10 10B.9 9C.9 10D.10 9

考题 有以下程序程序的输出结果是A.8 4B.9 6C.9 4D.8 5

考题 以下结构体的定义语句中,正确的是()A、structstudent{intnum;charname[10];intage;};stu;B、struct{intnum;charname[10];intage;}student;structstudentstu;C、structstudent{intnum;charname[10];intage;}stu;D、structstudent{intnum;charname[10];intage;};studentstu;

考题 设有以下说明语句:typedefstruct{intn;charch[8];}PER;则下面叙述中正确的是()A、PER是结构体变量名B、PER是结构体类型名C、typedefstruct是结构体类型D、struct是结构体类型名

考题 下列语句错误的是()。A、char*p=“John”;p[2]=‘a’;B、charname[5]=“John”;name[2]=’a’;C、charname[5]=“John”,*p=name;p[2]=‘a’;D、charname[5]=“John”,*p=name[1];p[2]=‘a’;

考题 单选题有以下程序: #include main() {  charname[10]={'S','T','R'};  name[2]='#';  name[6]=0;  printf(%s,name); } 程序运行后的输出结果是(  )。A ST#B STR#C STR#0D STR0