题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-08 13:37:12

[单选题]以下程序的输出结果是( )。
#include <iostream>
Using namespace std;
Int main() {
int a=0, i;
for (i=0;i<5;i++)
{
switch (i)
{
case 0:
case 3:a+=2;break;
case 1:
case 2:a+=3;
default:a+=5;
}
}
cout << a <<endl;
return 0;
}
A. 10
B. 20
C. 25
D. 30

更多"[单选题]以下程序的输出结果是( )。#include &lt;ios"的相关试题:

[单选题]以下程序的输出结果是( )。
#include
Using namespace std;
Int main()
{
int n=1;
while (n++<4);
cout << n << endl;
return 0;
}
A. 1
B. 5
C. 6
D. 4
[单选题]以下程序运行后输出结果是( )
#include
Using namespace std;
Int
A,b;
Void f()
{ int x=20,y=25;
a=a+x+y;
b=b+x-y;
}
Int main()
{ int x=9,y=7;
a=x+y;b=x-y;
f();
cout << a << "," << b << endl;
return 0;
}
A. 61,-3
B. 16,2
C. 25,-5
D. 以上都不正确
[单选题]下面程序的输出结果是( )。
#include
Using namespace std;
Void add()
{
static int a;
a++;
cout<}
Int main()
{
for(int i=0;i<3;i++)
add();
return 0;
}
A. 1 1 1
B. 1 2 3
C. 2 2 2
D. 3 3 3
[单选题]以下程序的运行结果是( )。
#include
Using namespace std;
Int main()
{
int x=1;
switch(x)
{ case 1:++x;
case 0:--x;
default: x+=7;
}
cout << x << endl;
return 0;
}
A. 2
B. 1
C. 7
D. 8
[单选题]有以下程序
#include
Using namespace std;
Int main(){
int a;
cin >> a;
if(a++<9) cout << a;
else cout << a--;
return 0;
}
程序运行时从键盘输入9 回车,则输出结果是( )。
A. 10
B. 11
C. 9
D. 8
[单选题]下列程序的运行结果是:( ) #include using namespace std; int main() { int a=2; int b=a+1; cout<A.0.66667
B.0
C.0.7
D.0.6666666…
[单选题]执行下列程序语句后,屏幕输出为( )。
#includeUsing namespace std;
Int n=5;
Int main()
{
int n=3;
n++;
::n++;
cout< return0;
}
A. 3
B. 4
C. 5
D. 6
[简答题]以下程序的运行结果为 )。
#include
Using namespace std;
Int a{5};
Int main()
{
{
int a{2};
cout << ::a;
cout << a;
}
cout << a << endl;
return 0;
}
[单选题]

执行以下语句输出的结果是( )
i=0
while i<5:
    i+=1
    if i==4:
        continue
    else:
        print(i)


A.

0,1,2,3,4


B.

1,2,3,4,5


C.

0,1,2,3


D.

1,2,3,5

[单选题]

执行以下语句输出的结果是( )
a=True
b=False
if a or b and a:
    print('yes')
else:
    print('no')


A.

yes


B.

no


C.

True


D.

False

[填空题]以下程序的输出结果是__()____。
#include
Using namespace std;
Int main(
{
int s,i;
for ( s=0,i=1; i<4; i++,s+=i );
cout << s << endl;
return 0;
}
[单选题]以下程序输出结果是 。 #include "stdio.h" void f (); main() {int a; for(a=1;a<=3;a++) fun(); } void fun() {static int i=1; i+=3; printf("%2d",i); }
A.4 7 10
B.4 4 4
C.4 5 6
D.4 6 8
[单选题]有如下程序: #include using namespace std; class Base{ protected: Base(){cout<<'A';} Base(char c){cout<A.B
B.BA
C.AB
D.BB
[单选题]有如下程序:
#include
Using namespace std;
Void function2(int n);
Void function1(int n){
if(n<=0) return;
function2(n-2);
}
Void function2(int n){
if(n<=0) return;
function1(n-1);
}
Int main){
function1(5);
return 0;
}
下列关于程序运行情况的描述中,正确的是( )。
A. function1运行1次,function2运行2次
B. function1运行2次,function2运行1次
C. function1运行2次,function2运行3次
D. function1运行2次,function2运行2次
[单选题]执行下列程序时输入123<空格>456<空格>789<回车> 输出结果是 ()。 main() { char s[100]; int c, i; scanf("%c",&c); scanf("%d",&i); scanf("%s",s); printf("%c,%d,%s\n",c,i,s); }
A.123456789
B.1456789
C.1,23,456,789
D.1,23,456

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码