[单选题]

有以下程序 include include typedef stmct{ char name[9];char sex;flo

有以下程序

#include <stdio.h>

#include <string.h>

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

void 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[i]=b.score[i];

main( )

{ STU c={"Qian",'f',95.0,92.0};

f(c);printf("%s,%c,%2.0f,%2.0f/n",c.name,c.sex,c.score[0],c.score[1]) ;

}

程序的运行结果是

A.Qian,f,95,92

B.Qian,m,85,90

C.Zhao,f,95,92

D.Zhao,m,85,90

参考答案与解析:

相关试题

有以下程序 #include #include typedef struct

[单选题]有以下程序 include include typedef struct { cha有以下程序 #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;

  • 查看答案
  • 有下列程序:#include#include "string.h"typedef

    [单选题]有下列程序:includeinclude "string.h"typedef struct{char name[9]; char sex;float有下列程序: #include <stdio.h> #include "string.h" typedef struct{char name[9]; char sex;float score[2];}STU; void f(STU A) { STU b={"Zhao",'m',85.0,90.0}; int i; strcpy(a.n

  • 查看答案
  • 有下列程序:#include#include "string.h"typedef

    [单选题]有下列程序:includeinclude "string.h"typedef struct{char name[9]; char sex;float有下列程序: #include <stdio.h> #include "string.h" typedef struct{char name[9]; char sex;float score[2];}STU; void f(STU A) { STU b={"Zhao",'m',85.0,90.0}; int i; strcpy(a.n

  • 查看答案
  • 有以下程序#include <stdio.h>typedef struct{ i

    [试题]有以下程序#include <stdio.h>typedef struct{ int num;double s ; }REC;void fun1( REC x ){x.num=23; x.s=88.5;}main(){ REC a={16,90.0 };fun1(a);printf("%d/n",a.num);}程序运行后的输出结果是 ( 1 4 ) 。

  • 查看答案
  • 下列程序的运行结果为()。#include main(){stmct date

    [单选题]下列程序的运行结果为()。include main(){stmct date {int year,month,day; }today; pr下列程序的运行结果为( )。 #include <stdio.h> main() { stmct date {int year,month,day; }today; printf("%d/n",sizeof(struct date)); }A.8B.6C.10D.12

  • 查看答案
  • 下列程序的输出结果是()。 #include main() {stmct st

    [单选题]下列程序的输出结果是()。 include main() {stmct st {int y,x,z; }; union {long i; i下列程序的输出结果是( )。#include<stdio.h>main(){ stmct st{ int y,x,z;};union{ long i;int j;char k;}un;printf("%d,%d/n",sizeof(stmct st),sizeof(un));}A.6,2B.6,4C.8,4D.8,6

  • 查看答案
  • 下列程序的运行结果是()。 #include main() {stmct dat

    [单选题]下列程序的运行结果是()。 include main() {stmct date {int year,month,day; }today;下列程序的运行结果是( )。#include<stdio.h>main(){stmct date{int year,month,day;}today;primf("%d/n",sizeof(struct date));}A.8B.6C.10D.12

  • 查看答案
  • 有以下程序:#include #include using namespace

    [单选题]有以下程序:include include using namespace std;int main ( ){ char b1[8有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char b1[8] = "abcdefg"; char b2[8],*pb=b1+3; while (--pb>=b1) strcpy (b2, Pb) ; cout<<strlen (b2) <<en

  • 查看答案
  • 有以下程序:#include #include using namespace

    [单选题]有以下程序:include include using namespace std;class point{private: doub有以下程序: #include <iostream> #include <math> using namespace std; class point { private: double x; double y; public: point(double a,double b) { x=a; y=b; } friend double distance(point

  • 查看答案
  • 有以下程序:#include #include using namespace

    [单选题]有以下程序:include include using namespace std;class Y;class X{private有以下程序: #include <iostream> #include <string> using namespace std; class Y; class X { private: int x; char *strx; public: X(int a, char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(

  • 查看答案