首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

(38)有以下程序#include <stdio.h>struct S{ int a,b;}data[2]={10,100,20,200};main(){ s

(38)有以下程序

#include <stdio.h>

struct S

{ int a,b;}data[2]={10,100,20,200};

main()

{ struct S p=data[1];

printf("%d\n",++(p.a));

}

程序运行后的输出结果是

A)10

B)11

C)20

D)21

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“(38)有以下程序#include <stdio.h>str…”相关的问题
第1题
有以下程序:#include <iostream>#include <string>using namespace std;int main (){ char s[]="

有以下程序: #include <iostream> #include <string> using namespace std; int main () { char s[]="\n123\\"; cout<<strlen (s) <<", "<<sizeof (s) <<end1; return 0; }

A.赋初值的字符串有错

B.6,7

C.5,6

D.6,6

点击查看答案
第2题
有以下程序:#include<stdio.h>#include<string.h>#includevoid f(char*s,char*t){char k;k=*s; *

有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是()。

A.abcdefg

B.gfedcba

C.gbcdefa

D.abedcfg

点击查看答案
第3题
有以下程序#include <stdio.h> #define S(x) (x)*x*2 main(){ int k=5, j=2; printf("%d

有以下程序

#include <stdio.h>

#define S(x) (x)*x*2

main()

{ int k=5, j=2;

printf("%d,”,s(k+j) ); printf(”%d\n”,s((k-j) ) );

}

程序运行后的输出结果是

A) 98,18

B) 39,11

C) 39,18

D) 98,11

点击查看答案
第4题
有以下程序#include<stdio.h>void fun(char**p){++p;printf("%s",*p);}main{cha

有以下程序

#include<stdio.h>

void fun(char**p)

{++p;printf("%s",*p);}

main

{char*a[]={"Morning","Afternoon","Evening"," Night");

fun(a);

}

程序的运行结果是()。

A.Afternoon

B.fternoon

C.Morning

D.orning

点击查看答案
第5题
有以下程序: #include<stdio.h>struct S{int a,b;)data[2]=10,100,20,200); main(){stru

有以下程序:

#include<stdio.h>

struct S

{int a,b;)data[2]=10,100,20,200);

main()

{struct S p=data[l];

printf("%d\n",++(p.a));

}

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

A.10

B.11

C.20

D.21

点击查看答案
第6题
有以下程序: #include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); }

有以下程序: #include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); } 程序运行后的输出结果是()。

A.tuv

B.字符t的ASCIl码值

C.t

D.出错

点击查看答案
第7题
有以下程序: #include<stdio.h> #define S(x)4*(x)*x+1 main() {int k=5,j=2; printf

有以下程序: #include<stdio.h> #define S(x)4*(x)*x+1 main() {int k=5,j=2; printf("%d\n",S(k+j)); } 程序运行后的输出结果是()。

A.197

B.143

C.33

D.28

点击查看答案
第8题
有以下程序 #include<stdio.h>voidfun(char**p){++p;printf(“%s\n”,*p);}main(){

有以下程序

#include<stdio.h>

void fun(char **p)

{

++p; printf(“%s\n”,*p);

}

main()

{

char *a[]={“Morning”,”Afternoon”,”Evening”,”Night”};

fun(

A.;

}

程序的运行结果是()。

A.Afternoon

B.fternoon

C.Morning

D.orning

点击查看答案
第9题
有以下程序:#include <stdio.h>main(){int i,s=0,t[] = {1,2,3,4,5,6,7,8,9};for(i=0;i<9;i+=2)

有以下程序:#include <stdio.h>main(){ int i,s=0,t[] = {1,2,3,4,5,6,7,8,9}; for(i=0;i<9;i+=2) s+=*(t+i); prinff("% d \n ",s);

A.45

B.20

C.25

D.36

点击查看答案
第10题
有以下程序:#include<iostream>using namespace std;class sample{private:int x;public:sample(

有以下程序: #include<iostream> using namespace std; class sample { private: int x; public: sample(int A) { x=a; friend double square(sample s); }; double square(sample s) { return S.X*S.K; } int main() { sa

A.20

B.30

C.900

D.400

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改