题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-02-11 22:39:20

[单项选择]有以下程序:
#include<iostream.h>
void main( )

int x=5,y=2;
cout<<!(y==x/2)<<",";
cout<<y!=x%3)<<",";
cout<<(x>0&&y<0)<<",";
cout<<(x!=y‖x>=y)<<endl:

程序执行后的输出结果是( )
A. 0,0,0,1
B. 1,1,1 1
C. 0,0, 1,1
D. 1,1,0,0

更多"有以下程序: #include<iostream.h> void "的相关试题:

[填空题]以下程序的输出结果是______。   #include   void main( )   { int a=0;   a+=(a=8);   cout<<a;   }
[单项选择]下列程序的输出结果是 #include void main( ) { char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=’/0’;i++) switch(str[i]) { case’1’:x4++; case’2’:x3++; case’3’:x2++; case’4’:x1++; } cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[单项选择]有如下程序 #include void main( ) { char ch[2][5]={" 6937"," 8254"},* p[2]; int i,j,s=0; for(i=0;i<2;i++)p[i]=ch[i]; for(i=0;i<2;i++) for(j=0;p[i][j]>,/’0’,;j+=2) s=10 * s+p[i][j]-’0’; cout < < S;} 该程序的输出结果是
A. 69825
B. 63825
C. 6385
D. 693825
[填空题]下列程序的执行结果为【15】。
#include
void main( )

cout.fill( ’ * ’ );
cout.width(10);
cout<<"hello"<
[单项选择]下列程序的输出结果是
#include
void main( )
char * str="12123434";
int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++)
switch(str[i])
case’1’:x4++;
case’2’:x3++;
case’3’:x2++;
case’4’:x1++;

cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[填空题]下列程序的执行结果为【15】。
#include
void main( )
{
cout.fill( ’ * ’ );
cout.width(10);
cout<<"hello"< }

[单项选择]若有如下语句   #include   void main( )   {   int x=3;   do{   x=x-2;   cout<<x;   }while(!(--x));   }   则上面程序段
A. 输出的是1
B. 输出的是1和-2
C. 输出的是3和0
D. 是死循环
[单项选择]阅读以下程序

#include<fstream.h>

void main( )



ifstream infile;

ofstream outfile;

fstream iofile;

iofile.open("a.txt",ios::in);

iofile.close( );

iofile.open("b.txt",ios::out);



下列描述错误的是
A. 对象infile只能用于文件输入操作
B. 对象outfile只能用于文件输出操作
C. 对象iofile在文件关闭后,不能再打开另一个文件
D. 对象iofile可以打开一个文件同时进行输入和输出
[填空题]阅读以下程序:
#include<iostream.h>
void main( )

static int a[][3]=9,7,5,3,1,2,4,6,8;
int i,j,s1=0,s2=0;
for(i=0;i<3;i++)
for(j=0;j<3;j++)

if(i==j)s1=sl+a[i][j];
if(i+j==2)s2=s2+a[i][j];

cout<<s1<<","<<s2<<endl;

则该程序的输出结果为 【15】
[单项选择]以下程序的输出结果是
#include <iostream.h>
void main( )

int a=0,i;
for(i=1 ;i<5;i++)

switch(i)

case 0:
case 3: a+=2;
case 1:
case 2: a+=3;
default: a+=5;


cout<<a<<end1;
return;

A. 31
B. 13
C. 10
D. 20
[填空题]阅读以下程序: #include<iostream.h> void main( ) { static int a[][3]={9,7,5,3,1,2,4,6,8}; int i,j,s1=0,s2=0; for(i=0;i<3;i++) for(j=0;j<3;j++) { if(i==j)s1=sl+a[i][j]; if(i+j==2)s2=s2+a[i][j]; } cout<<s1<<","<<s2<<endl; } 则该程序的输出结果为 【15】

我来回答:

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

订单号:

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