题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-11 10:44:45

[单项选择]对下列程序的描述正确的是( )。 #include <iostream> using namespace std; int fuc(int,int); int main( ){ cout<<fuc(1,10)<<endl; return 0; } int fuc(int x,int y){ return x*x+y*y; }
A. 该函数的定义和调用方式都是错误的
B. 该函数的定义和调用方式都是正确的
C. 该函数调用方式正确,但函数定义错误
D. 函数定义正确,但函数调用方式错误

更多"对下列程序的描述正确的是( )。 #include <iostre"的相关试题:

[单项选择]有以下程序,其输出结果是( )。 #include <iostream> using namespace std; int main( ){ char a[10]={'1','2','3','4','5','6','7','8','9',0},*p; int i=8; p=a+i; cout<<p-3<<endl; return 0; }
[单项选择]运行以下的程序代码,结果是( )。 #include<iostream> using namespace std; intmain( ) { int x=5; int *q=&x; int &y=x; y++; tout<<(*q)++<<end1; return 0; }
A. 5
B. 6
C. 7
D. 8
[单项选择]对下面的程序,说法正确的是( )。 #include<iostream> using namespace std; void sum(float m, float n) { float sum=m+n; } main( ) { cout<<sum(5.3,6.5)<<endl;}
A. 该程序是错误的,错误之处在于没有对sum()函数进行说明
B. 程序书写规整,无语法错误,是正确的
C. 该程序语法无错误,但在调用函数sum()时出错,因为sum()函数被定义为viod类型,但却被主函数调用,因而是错误的
D. 虽然sun()函数被定义为void类型,但调用时也不会出错,程序能够编译通过
[单项选择]对下面程序描述正确的是( )。 #include < iostream > using namespace std; class A { private: int i; public: class B { private: int j; protected: int k; int fun1 ( ); } MyB; int fun2 ( ); }
A. 定义类B的对象的语句是: A::B b;
B. 类A的成员函数fun2()可以用Myj的方式访问类B的私有成员j。
C. 类A的成员函数fun2()可以用Myk的方式访问类B的保护成员k。
D. 类B的成员函数fun1()可以直接访问类A的私有成员i。
[单项选择]对下列程序的描述中,正确的是( )。 #include<iostream> using namespace std; int Fun(int,int); int main( ) { cout<<Fun(5,50)<<end1; return 0; } int Fun(int x,int y) { return x*x+y*y; }
A. 该函数定义正确,但函数调用方式错误
B. 该函数调用方式正确,但函数定义错误
C. 该函数的定义和调用方式都是正确的
D. 该函数的定义和调用方式都是错误的
[单项选择]有如下程序: #include<iostream> using namespaee std; class VAC{ public: int f( )COUSt{return 3;} int f( ){return 5;} }; int main( ){ VAC vl; const VAC v2; eout<<v1.f( )<<v2.f( ); return 0; } 程序的输出结果是
A. 53
B. 35
C. 55
D. 33
[单项选择]有以下程序: #include <iostream> using namespace std; int main ( ) { int n; cin>>n; if (n++<10) cout<<n<<end1; else cout<<n--<<end1; return 0; } 若执行该程序时从键盘上输入9,则输出结果是( )。
A. 11
B. 10
C. 9
D. 8
[单项选择]有如下程序: #include<iostream) using namespace std; classBASE{ public: ~BASE( ){cout<<“BASE”;} }; class DERIVED://public BASE{ public: ~DERIVED( ){COUt<<“DERIVED”;} }; int main( ){DERIVED x;return 0;} 执行后的输出结果是( )。
A. BASE
B. DERIVED
C. BASEDERIVED
D. DERIVEDBASE

我来回答:

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

订单号:

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