首页 > 公务员考试
题目内容 (请给出正确答案)
[主观题]

有以下程序 #include"iostream.h" void main() { int i=1,j=1,k=2; if((j++||k++)&

有以下程序 #include"iostream.h" void main() { int i=1,j=1,k=2; if((j++||k++)&&i++) cout < < i < < "," < < j < < "," < < k; cout< <end1; } 执行后输出结果是

A.1,1,2

B.2,2,1

C.2,2,2

D.2,2,3

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序 #include"iostream.h" voi…”相关的问题
第1题
有以下程序()

A.#include

B.5

C.24

D.32

E.40

点击查看答案
第2题
有以下程序(strcat函数用以连接两个字符串)#include<stdio.h>#include<string.h>main(){char a[20]=”ABCD\0EFG\0”,b[]=”IJK”;strcat(a,b);printf(”%s\n”,a);}程序运行后的输出结果是()。

A.ABCDE\0FG\0IJK

B.ABCDIJK

C.IJK

D.EFGIJK

点击查看答案
第3题
有以下程序#include<stdio.h>#include<string.h>main(){char x[]=“STRING”;x[0]=0;x[1]=’\0’;x[2]=’0’;printf(”%d%d\n”,sizeof(x),strlen(x));}程序运行后的输出结果是()。

A.6 1

B.7 0

C.6 3

D.7 1

点击查看答案
第4题
有以下程序#include <stdio.h>#include <string.h>typedef struct{ char name[

有以下程序

#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",'f',95.0,92.0},d;

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

}

程序的运行结果是

A)Qian,f,95,92

B)Qian,m,85,90

C)Zhao,m,85,90

D)Zhao,f,95,92

点击查看答案
第5题
有以下程序#include<stdio.h>int f(int x);main(){int n=1,m;m=f(f(f(n)));printf(”%d\n”,m);}int f(int x){return x*2;}程序运行后的输出结果是()。

A.1

B.2

C.4

D.8

点击查看答案
第6题
以下程序的功能是求两个非0整数相除的商和余数。程序有几处错误,试找出它们加以修改,并上机验证修改结果。 #include iostream using namespace std; int main() {int x,y,r1,r2; cin>>x>>y; if(x=0||y=0..

以下程序的功能是求两个非0整数相除的商和余数。程序有几处错误,试找出它们加以修改,并上机验证修改结果。 #include "iostream" using namespace std; int main() {int x,y,r1,r2; cin>>x>>y; if(x=0||y=0) cout<<”input else { if(x> y) r1=x/y; r2=x%y; else r1=y/x; r2=y%x; } cout<<”商=> <<” 余数="”<"> < <endl; system("pause"); return 0;>

点击查看答案
第7题
微信小程序里面只有通过以下哪个方法可以导入模块()。

A.import

B.module.import

C.require

D.include

点击查看答案
第8题
以下程序的输出结果是_______。#include<stdio.h>main(){ int i;for(i=1;i<5;i++){ if(i%2)printf

以下程序的输出结果是_______。 #include<stdio.h> main() { int i; for(i=1;i<5;i++){ if(i%2)printf("*"); else continue; printf("#"); } printf("$\n"); }

A.*#*#*#$

B.#*#*#*$

C.*#*#$

D.#*#*$

点击查看答案
第9题
在编写红外数据接受程序时,需要调用红外类库的头文件,以下调用该头文件的程序正确的是?()

A.#includeIRremote.h

B.#includeIRremote

C.#include

D.#include‘IRremote.h’

点击查看答案
第10题
给定以下程序段insert code public class foo {public static void main (String[] args) throws

给定以下程序段

insert code public class foo {

public static void main (String[] args) throws Exception {

printWriter ut = new PrintWriter (new java.io.outputStreamWriter (System.out), true) ;

out.printIn(“Hello”);

}

}

要使程序能正确运行,在insert code处必须添加()语句。

A、import java.io.PrintWriter;

B、include java.io.PrintWriter;

C、import java.io.OutputStreamWriter;

D、include java.io.OutputStreamWriter;

点击查看答案
第11题
(14 )以下程序用以删除字符串所有的空格,请填空。#include <stdio.h>main (){ char s[100]

(14 )以下程序用以删除字符串所有的空格,请填空。

#include <stdio.h>

main ()

{ char s[100]={ " Our teacher teach C language! " };int i,j;

for (i=j=0;s[i]!= ’ \0 ’ ;i++ )

if (s[i]!= ‘ ’ ) {s[j]=s[i];j++;}

s[j]= 【 14 】

printf (" %s\n " ,s ) ;

}

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