[单选题]

( 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 <s

[单选题]( 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 )

  • 查看答案
  • ( 37 )有以下程序#include <stdio.h>#include <s

    [单选题]( 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 )

  • 查看答案
  • ( 12 ) 有以下程序#include <stdio.h>#include <

    [试题]( 12 ) 有以下程序#include <stdio.h>#include <string.h>void fun ( char *str ){ char temp;int n,i;n=strlen ( str ) ;temp=str[n-1];for ( i=n-1;i>0;i-- ) str[i]=str[i-1];str[0]=temp;}main (){ char s[50];scanf ( " %s " ,s ) ; fun ( s ) ; printf

  • 查看答案
  • (37)有以下程序 #include <stdio.h> struct ord

    [单选题](37)有以下程序#include <stdio.h>struct ord{ int x,y;} dt[2]={1,2,3,4};main(){ struct ord *p=dt;printf (“%d,”,++p->x); printf(“%d/n”,++p->y);}程序的运行结果是A.)1,2 B)2,3 C)3,4 D)4,1

  • 查看答案
  • 有以下程序#include <stdio.h>#include <string.

    [单选题]有以下程序#include <stdio.h>#include <string.h>void fun(char s[][10],int n){ char t;int i,j;for(i=0;i<n-1;i++)for(j=i+1;j<n;j++)/* 比较字符串的首字符大小,并交换字符串的首字符 */if (s[i][0] > s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}}main(){ char ss[

  • 查看答案
  • 有以下程序#include <stdio.h>#include <string.

    [单选题]有以下程序#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[i]=b.score[i];retur

  • 查看答案
  • 有以下程序#include <stdio.h>#include <stdlib.

    [单选题]有以下程序#include <stdio.h>#include <stdlib.h>int fun(int n){ int *p;p=(int*)malloc(sizeof(int));*p=n; return *p;}main(){ int a;a = fun(10); printf("%d/n",a+fun(10));}程序的运行结果是A.)0B.)10C.)20D.) 出错

  • 查看答案
  • 有以下程序#include <stdio.h>#include <string.

    [单选题]有以下程序#include <stdio.h>#include <string.h>main(){ char str[ ][20]={"One*World","One*Dream!"},*p=str[1];printf("%d,",strlen(p));printf("%s/n",p);}程序运行后的输出结果是A.)9,One*WorldB.)9,One*Dream !C.)10,One*Dream !D.)10,One*World

  • 查看答案
  • 有以下程序#include <stdio.h>#include <string.

    [单选题]有以下程序#include <stdio.h>#include <string.h>main(){ char a[10]="abcd";printf("%d,%d/n",strlen(a),sizeof(a));}程序运行后的输出结果是A.)7,4B.)4,10C.)8,8D.)10,10

  • 查看答案
  • 有以下程序#include <stdio.h>#include <stdlib.

    [单选题]有以下程序#include <stdio.h>#include <stdlib.h>int fun(int t){ int *p; p=(int*)malloc(sizeof(int)); *p=t; return *p;}main(){ int a; a = fun(8); printf("%d/n", a+fun(10));}程序的运行结果是A.0 B.10 C.18 D.出错

  • 查看答案
  • ( 37 )有以下程序#include <stdio.h>#include <s