题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-03 15:54:32

[单项选择]有如下程序   #include<iostream.h>   voidmain( )   { charch[2][5]={"6937","8254"},*p[2];     inti,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. 选择和投影
B. 投影和选择
C. 选择和联接
D. 投影和联接

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

[单项选择]有如下程序   #include<iostream.h>   voidmain( )   { charch[2][5]={"6937","8254"},*p[2];     inti,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. 选择和投影
B. 投影和选择
C. 选择和联接
D. 投影和联接
[单项选择]有下列程序:   #include   voidmain()   {char*a[]={"abcd","ef","gh","ijk");inti;   for(i=0;i<4;i++)printf("%C",*a[i]);   }   程序运行后的输出结果是(  )。
A. aegi
B. dfhk
C. abcd
D. abcdefghijk
[填空题]以下程序输出的结果是 【7】 
  #include<iostream.h>
  voidmain( )
  
    inta=5,b=4,c=3,d;
    d=(a>b>c);
    cout<<d;

[填空题]下面程序的结果为 【7】
#include<iostream.h>
voidmain( )

int a=1,b=2;
bool c=1;
if((a>b)||(c)cout <<"ture" <<end1;
else
cout <<"false" <<end1;

[填空题]下列程序的输出结果为 【8】
include<iostream.h>
voidmain( )inta []=10,20,30,40,*pa=a;
int*&ph=pa;
Pb++;
cout<<*pa<<end1;

[单项选择]有如下程序 #include #include using namespace std; class MyClass{ public: MyClass( ){cout<<′A′;} MyClass(char c){cout<<′c′;} MyClass( ){cout<<′B′;} } int main( ){ MyClass pl,*p2; p2=new MyClass(′X′); delete p2; retum 0; } 执行这个程序屏幕上将显示输出【 】
A. ABX
B. ABXB
C. AXB
[单项选择]有如下程序 #include #include using namespace std; int main( ) cout<A. setprecision(3)
B. fixed
C. setfill(′*′)
D. setw(8)
[简答题]有如下程序 #include #include using namespace std; class MyClass{ public: MyClass( ){cout<<’A”;} MyClass(char c {cout<A. A.ABX
B.ABXB
C.AXB
D.AXBB

[单项选择]有如下程序: #include #include using namespace std; class MyString{ public; char str[80]; MyString(const char*s) {strcpy(str,s);} MyString&operator+=(MyString a){ strcat(str,a.str); return*this; } }; ostream&operator<<(ostream&s,const MyString&z){return s << z.str} int main( ){ MyString x("abc"),y("cde"); cout<<(x+=y)<A. abc
B. cde
C. abcde
D. abccde
[单项选择]有如下程序:   #include   usingnamespacestd;   intmain()   {   int*P;   *P=9:   cout<<"ThevalueatP:"<<*P;   return0;   }   编译运行程序将出现的情况是(  )。
A. 编译时出现语法错误,不能生成可执行文件
B. 运行时一定输出ThevalueatP:9
C. 运行时一定输出ThevalueatP:*9
D. 运行时有可能出错
[单项选择]有如下程序: #include using namespace std; class Boat; class Car{ public: Car(int i):weight(i){ } friend int Total(const Car &c.const Boat &b); //① private: int weight; }; class Boat{ public: Boat(int i):weight(i){ } friend int Total(const Car &c,const Boat &b); private: int weight; }; int Total(const Car &c,const Boat &b){ //② return c.weight+b.weight; } int main( ){ Car c(10); Boat b(8); cout<<"The total weight is"<A. 程序编译正确
B. 程序编译时语句①出错
C. 程序编译时语句②出错
D. 程序编译时语句③出错
[单项选择]有如下程序
#include <iostream>
#include <iomanip>
using namespace std;
int main( )
cout<<setprecision(3)<<fixed<<setfill(’*’)<<setw(8);
cout<<12.345<<__________<<34.567;
return 0;

若程序的输出是:
**12.345**34.567
则程序中下划线处遗漏的操作符是( )。
A. setprecision(3)
B. fixed
C. setfill(’*’)
D. setw(8)

我来回答:

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

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码