题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-21 22:43:57

[单选题]下列程序运行后的输出结果是( )。
#include <iostream>
Using namespace std;
Int main()
{
int x,y,z;
for (x=0;x<=3;x++)
z=x;
for (y=5;y>=1;y--)
z+=y;
cout << z << endl;
return 0;
}
A. 15
B. 16
C. 17
D. 18

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

[单选题]以下程序运行后输出结果是( )
#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;
Int main(){
int a=2,b=-1,c=2;
if(a if(b<0) c=0;
else c+=1;
cout << c << endl;
return 0;
}
A. 0
B. 1
C. 2
D. 3
[单选题]执行下列程序后,屏幕的输出是( )。
#include
Using namespace std;
Void swap(int
A,int b)
{
int temp=a;
a=b;
b=temp;
cout<<"a="<}
Int main()
{
int a=3,b=2;
swap(a,b);
cout<<"a="< return 0;
}
A. a=2,b=3
A=3,b=2
B. a=3,b=2
A=3,b=2
C. a=2,b=3
A=2,b=3
D. a=3,b=2
A=2,b=3
[单选题]执行下列程序时输入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
[单选题]执+264:291行下列代码,程序的输出结果是:( ) cout <<″Hex:″<< hex << 255;
A. ff
B.hex:ff
C.Hex:ff
D. f
[单选题]下面程序的输出结果是( )
#include
Void main( )
{ int x=10,y=10,i;
For(i=0;x>8;y=++i)
Printf("%d %d ",x--,y);
}
A. 10 1 9 2
B. 9 8 7 6
C. 10 9 9 0
D. 10 10 9 1
[单选题]以下程序的输出结果是( )。
#include
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 < return 0;
}
A. 10
B. 20
C. 25
D. 30
[单选题]

执行以下语句输出的结果是( )
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;
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 n=10;
while(n>7){
n--;
cout< }
cout<}
A. 10,9,8
B. 9,8,7
C. 10,9,8,7
D. 9,8,7,6
[单选题]执行下列程序后,输出结果是( )。
#include
Using namespace std;
Void f(int x)
{
if(x)
{
cout.put(‘0’+x%10);
f(x/10);
}
}
Int main()
{
f(11001);
return 0;
}
A. 11001
B. 10001
C. 11100
D. 10011
[单选题]若执行下面的程序从键盘上输入9,则输出结果是( )
#include
Void main( )
{int n;
Scanf("%d",&n);
If (n++<10) printf("%d\n",n);
Else printf("%d\n",n--);}
A. 11
B. 10
C. 9
D. 8
[单选题]下列程序执行后的输出结果是( )。
#include
#include
Using namespace std;
Int main()
{ char arr[2][4];
strcpy(arr[0],"you");
strcpy(arr[1],"me");
arr[0][3]=′&′;
cout << arr[0]; //因第一行无\0,故第二行接着输出
return 0;
}
A. you&me
B. you
C. me
D. err
[填空题]以下程序的输出结果是__()____。
#include
Using namespace std;
Int main(
{
int s,i;
for ( s=0,i=1; i<4; i++,s+=i );
cout << s << endl;
return 0;
}
[单选题]

执行以下语句,用户输入整数5,输出的结果是( )
n=int(input())
d={}
for i in range (1,n+1):
     d[i]=i*i
print(d)


A.

{1: 1, 2: 4, 3: 9, 4: 16, 5: 25}


B.

[1,4,9,16,25]


C.

{1: 1, 2: 4, 3: 9, 4: 16, 5: 25,6:36}


D.

[1,4,9,16,25,36]

[单选题]

下面代码的输出结果是:

s=[“seashell”,“gold”,“pink”,“brown”,“purple”,“tomato”]

print(s[1:4:2])



A.

[‘gold’, ‘pink’, ‘brown’]


B.

[‘gold’, ‘pink’]


C.

[‘gold’, ‘pink’, ‘brown’, ‘purple’, ‘tomato’]


D.

[‘gold’, ‘brown’]

我来回答:

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

订单号:

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