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

题目内容 (请给出正确答案)
有以下程序 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; for (i=0; i<2; i++) a.score[i] = b.score[i]; return a; } main() { STU c={"Qian", T, 95.0, 92.0}, d; d=f(c); printf("%s,%c,%2.0f,%2.0f\n", d.name, &sex, &score[O], d.score[1]); } 程序的运行结果是

A.Qian, f,95,92

B.Qian,m,85,90

C.Zhao,m,85,90

D.Zhao,f,95,92


参考答案

更多 “ 有以下程序 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; for (i=0; i<2; i++) a.score[i] = b.score[i]; return a; } main() { STU c={"Qian", T, 95.0, 92.0}, d; d=f(c); printf("%s,%c,%2.0f,%2.0f\n", d.name, sex, score[O], d.score[1]); } 程序的运行结果是A.Qian, f,95,92B.Qian,m,85,90C.Zhao,m,85,90D.Zhao,f,95,92 ” 相关考题
考题 有以下程序:include include main( ) {char a[ 7 ] = "a0 \0a0 \0";int i, 有以下程序:#include <stdio.h>#include <string.h>main( ) { char a[ 7 ] = "a0 \0a0 \0"; int i,j; i = sizeof(a); j = strlen(a); printf(" % d %d \n" ,i,j); }程序运行后的输出结果是( )。A.22B.76C.72D.62

考题 阅读下列程序,则在执行后,程序的运行结果为 #include"stdio.h" #include"string.h" main() { char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s\n",a);}A.nice to meet you youB.nice toC.meet you youD.nice to you

考题 以下程序:includeincludemain(){char str[]="abcd\n\123\xab";printf("%d" 以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd\n\123\xab"; printf("%d",(str)); } 运行后的输出结果是( )。A.10B.9C.7D.14

考题 有以下程序:include include using namespace std;class base{private: cha 有以下程序: #include <iostream> #include <string> using namespace std; class base { private: char baseName[10]; public: base ( ) { strcpy (baseName, "Base"); } virtual char *myName() {A.DerivedBaseB.BaseBaseC.DerivedDerivedD.BaseDerived

考题 有以下程序:include include main(){char *p[10]={"abc","aabdfg","dcdbe" 有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是( )。A.2B.3C.4D.5

考题 在下列# include命令中,正确的一条是 ( )A.# include [string.h]B.# include {math.h}C.# include(stdio.h)D.# include<stdio.h>

考题 有以下程序:includeincludemain(){char str[][20]={"Hello","Beijing"},*P 有以下程序: #include <stdio.h> #include <string.h> main() { char str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是( )。A.0B.5C.7D.20

考题 当执行下面的程序时,如果输入ABC,写出程序输出结果 #include "stdio.h" #include "string.h" main() { char ss[10]; gets(ss); strcat(ss,"6789"); printf("%sn",ss); }

考题 以下程序运行后的输出结果是() 。   #include <stdio.h>   #include <stdlib.h>   #include <string.h>   main()   { char *p; int i;    p=(char *)malloc(sizeof(char)*20);    strcpy(p,"welcome");    for(i=6;i>=0;i--) putchar(*(p+i));    printf("n"); free(p);   }

考题 分析下面程序的运行结果()。 #include "stdio.h" #include "string.h" main() { printf("%dn",strlen("IBMn012")); }