题目内容 (请给出正确答案)
[主观题]

试题36有以下程序#include <stdio.h>#include <string.h>Typedef struct {char name

试题36

有以下程序

#include <stdio.h>

#include <string.h>

Typedef struct {char name[9]; char sex; int score[2];}STU;

STU f(STU a)

{ STU b={“Zhao”, ‘m’, 85, 90};

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”, ‘f’, 95, 92},d;

d=f(c);

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

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

}

程序运行后的输出结果是()

A.Zhao, m, 85,90, Qian, f, 95, 92

B.Zhao, m, 85,90, Zhao, m, 85, 90

C.Qian, f, 85,90, Qian, f, 95, 92

D.Qian, f, 95, 92, Zhao, m, 85, 90

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“试题36有以下程序#include <stdio.h>#in…”相关的问题

第1题

试题34有以下程序#include <stdio.h>main(){ char ch[3][5]={“AAAA”, ”BBB”, ”CC”};printf(“%s\n”, ch[1];)}程序运行后的输出结果是()

A.AAAA

B.CC

C.BBBCC

D.BBB

点击查看答案

第2题

试题22有以下程序(注:字符a的ASCII码值为97)()#include <stdio.h>main(){ char *s ={“abc”};do{ printf(“%d”, *s%10); ++s;}While(*s);}程序运行后输出结果是()

A.abc

B.789

C.7890

D.979899

点击查看答案

第3题

试题35有以下程序#include <stdio.h>#include <string.h>void fun(char *w,int m){ char s, *p1, *p2;p1=w; p2=w+m-1;while(p1<p2){s=*p1; *p1=*p2; *p2=s; p1++; p2- -;}}main(){ char a[]=”123456”;fun(a, strlen(a)); puts(a);}程序运行后的输出结果是()

A.654321

B.116611

C.161616

D.123456

点击查看答案

第4题

(36)有以下程序 #include <stdio.h> #define PT 3.5; #define S(x) PT*x*x; main() {

(36)有以下程序

#include <stdio.h>

#define PT 3.5;

#define S(x) PT*x*x;

main()

{ int a=1, b=2; printf(“%4.1f\n”,S(a+b));}

程序运行后输出的结果是

A)14.0 B)31.5 C)7.5 D)程序有错无输出结果

点击查看答案

第5题

有以下程序: #include<string.h> int a=4; int f(int n) {int t=0;static int a=5; if(n%2) {int a=6;t++=a++;} else{int a=7;t+=a++;} return t+a++; } main() {int s=a,i=0; for(;i<2;i++)s+=f(i); printf("%d\n",s); } 程序运行后的输出结果是()。

A.24

B.28

C.32

D.36

点击查看答案

第6题

试题20有以下程序#include <stdio.h>main(){ int a=7;while(a- -);printf(“%d\n”,a);}程序运行后的输出结果是()

A.-1

B.0

C.1

D.7

点击查看答案

第7题

试题12有以下程序#include <stdio.h>main(){ int c[3]={0}, k, i;while((k=getchar())!=’\

试题12

有以下程序

#include <stdio.h>

main()

{ int c[3]={0}, k, i;

while((k=getchar())!=’\n’)

c[k-‘A’]++;

for(i=0; i<3; i++) printf(“%d”, c[i]); printf(“\n”);

}

若程序运行时从键盘输入ABCACC<回车>, 则输出结果为______.

点击查看答案

第8题

试题38有以下程序#include <stdio.h>main(){ int a=2,b;b=a<<2; printf(“%d\n”,b);}程序运行后的输出结果是()

A.2

B.4

C.6

D.8

点击查看答案

第9题

试题14以下程序调用fun函数把x中的值插入到a数组下标为k的数组元素中。主函数中,n存放a数组中数据

试题14

以下程序调用fun函数把x中的值插入到a数组下标为k的数组元素中。主函数中,n存放a数组中数据的个数。请填空。

#include <stdio.h>

void fun(int s[], int *n, int k, int x)

{ int i;

for(i=*n-1; i>=k; i- - ) s[ ___ ]=s[i];

s[k]=x;

*n=*n+______;

}

main()

{ int a[20]={1,2,3,4,5,6,7,8,9,10,11}, i, x=0, k=6, n=11;

fun(a, &n, k, x);

for(i=0; i<n; i++) printf(“%4d”,a[i]); printf(“\n”);

}

点击查看答案

第10题

试题27有以下程序#include <stdio.h>void fun(int *p){ printf(“%d\n”,p[5]);}main(){ int a[10]={1,2,3,4,5,6,7,8,9,10};fun(&a[3]);}程序运行后的输出结果是()

A.5

B.6

C.8

D.9

点击查看答案
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
温馨提示
每个试题只能免费做一次,如需多次做题,请购买搜题卡
立即购买
稍后再说
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
赏学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反赏学吧购买须知被冻结。您可在“赏学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
赏学吧
点击打开微信