题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-25 19:27:02

[填空题]

在下面程序的下划线处填上正确的语句。
    #include < iostream >   
   using namespace std;
    template < class T >
    T f( T&a, T&b, int n)
    {
       for (int i=0;i           a[i] =a[i] +b[i];
       return a ;
    }
    void main( )
    {
       In ta[5] ={1,2,3,4,5};
       int b[5] = { 100,200,3,4,51 , * p;
       for(int i =0;i <2;i ++)
          p=_________//调用函数f
       for( ;p          cout <<_________<< endl ;
    }


更多"在下面程序的下划线处填上正确的语句。 &nbsp;&nbsp;&nbs"的相关试题:

[填空题]以下程序的功能是用递归法求n!,请在下划线处填上正确的语句,使程序能正确运行。 #include long f(int n) { if(n==1)return(________); else return (________________); } main( ) { int n; printf("n="); scanf("%d",&n); printf("%d!=%ld",n,f(n)); }
[简答题]在下划线处填上缺少的部分。
#include<iostream.h>
class A
int a,b;
public:
______//定义构造函数,使参数i和j的默认值为0
a=i;b=j;//在函数体中用i初始化a,用j初始化b

main( )
A*p;
______;//调用带参构造函数生成由p指向的动态对象
//使a和b成员分别被初始化为4和5

[填空题]在下面横线上填上适当的语句,完成程序。 #include <iostream> using namespace std; class Base { int x; public: Base(int i){ x=i;} ~Base( ){} }; class Derived : public Base { public: ______//完成类Derive构造函数的定义 }; int main( ) { Derived Obj; return 0; } 在横线处应填入的语句是______。
[填空题]在下面横线上填上适当的语句,完成程序。
#include<iostream>
using namespace std;
class TestClass

int x;
public:
TestClass(int i)x=i;
~TestClass( )
;
class TestClass1:public TestClass

public;
______//完成类TestClassl构造函数的定义
;
int main( )

TestClass1 0bj( );
return 0;

[填空题]在下面横线上填上适当的语句,完成程序。 #include<iostream> using namespace std; class Base { int x; public: Base(int i){x=i;} ~Base( ){} }; class Derived:public Base { public: ___________//完成类Derive构造函数的定义 }; int main( ) { Derived Obj; return 0; } 在横线处应填入的语句是 【9】
[填空题]在下面横线上填上适当的语句,完成程序。
#include<iostream>
using namespace std;
class Base int x;
public:
Base(int i) x=i;
~Base( )
;
class Derived: public Basepublic:
【14】 //完成类Derive 构造函数的定义
;
int main( ) Derived Obj( );
return 0;

[填空题]在下面程序的横线处填上适当的语句,使该程序执行结果为10。 #include <iostream> using namespace std; class MyClass { public: MyClasS(int A) { X=a; } 【13】 //取x的值 private: int x; }; int main( ) { MyClass my(10); cout<<my.GetNum( )<<end1; return 0; }

我来回答:

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

订单号:

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