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

[单选题]有以下程序
#include <iostream>
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 &lt;iostream&gt;"的相关试题:

[单选题]有如下程序: #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;
Int a{5};
Int main()
{
{
int a{2};
cout << ::a;
cout << a;
}
cout << a << endl;
return 0;
}
[单选题]以下程序的输出结果是( )。
#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
[单选题]以下程序的运行结果是( )。
#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
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 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次
[单选题]下列程序的运行结果是:( ) #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…
[单选题]有以下程序
#include
Int i=0;
Void fun()
{
{
static int i=1;
std::cout< }
std::cout<}
Int main()
{
fun(); fun();
return 0;
}
程序执行后的输出结果是( )。
A. 1,2,1,2,
B. 1,2,2,3,
C. 2,0,3,0,
D. 1,0,2,0,
[单选题] 有以下程序
#include
#define N 20
Void fun(int a[],int n,int m)
{ int i ;
for(i=m;i>=n;i--)
{
A[i+1]=a[i];
}
Int main()
{ int i,a[N]={1,2,3,4,5,6,7,8,9,10};
fun(a,2,9);
for(i=0;i<5;i++)
{
Printf("%d",a[i]);
}
return 0;}
程序运行后的输出结果是( )。
A.10234
B.12344
C.12334
D.12234
[单选题]有以下程序段   #include   main()   { …   while( getchar()!='\n');   …   }   以下叙述中正确的是( )。
A.此while语句将无限循环
B.getchar()不可以出现在while语句的条件表达式中
C.当执行此while语句时,只有按回车键程序才能继续执行
D.当执行此while语句时,按任意键程序就能继续执行
[单选题]有以下程序
#include
Void swap(int
A,int b)
{
int t;
t = a;
a = b;
b = t;
}
Int main()
{
int a = 1;
int b = 2;
swap(a,b);
printf("%d,%d\n",a,b++);
return 0;
}
程序运行后的输出结果是( )。
A.1,2
B.1,3
C.2,1
D.2,2
[单选题]执行下列程序语句后,屏幕输出为( )。
#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;
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
[单选题]以下程序中,while循环的的循环次数为( )。
#include
Using namespace std;
Int main()
{
int i=0;
while (i<10)
{
if (i<10) continue;
if (i==5) break;
i++;
}
return 0;
}
A. 1
B. 10
C. 6
D. 死循环,不能确定次数

我来回答:

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

订单号:

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