题目内容 (请给出正确答案)
[单选题]

有以下程序int add (int a,int b){return (a+b); }main(){ int k,(*f)(),a=5,b=10;f=add;…}则以下函数调用语句错误的是

A.k=(*f)(a,b);

B.k=add(a,b);

C.k=*f(a,b);

D.k=f(a,b);

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“有以下程序 int add (int a,int b){re…”相关的问题

第1题

有以下程序int add(int a,int b){ return (a+b); }main(){ int k, (*f)(), a=5,b=10;f=add

有以下程序

int add(int a,int b){ return (a+b); }

main()

{ int k, (*f)(), a=5,b=10;

f=add;

}

则以下函数调用语句错误的是

A)k=(*f)(a,b);

B)k=add(a,b);

C)k= *f(a,b);

D)k=f(a,b);

点击查看答案

第2题

有以下程序:int add(int a,intB){return(a+B);}main(){int k,(*f)(),a=5,b=10;f=add;}则以下函数

有以下程序: int add(int a,intB){return(a+B);} main() { int k,(*f)(),a=5,b=10; f=add; } 则以下函数调用语句错误的是()。

A.k=(*f)(a,B);

B.k=add(a,B);

C.k=*f(a,B);

D.k=f(a,B);

点击查看答案

第3题

有以下程序 int add(int a,int b){return(a+b);} main() {int k,(*f)(),a=5,b=10; f=add; } 则以下函数调用语句错误的是

A.k=(*f)(a,b);

B.k=add(a,b);

C.k=*f(a,b);

D.k=f(a,b);

点击查看答案

第4题

有以下程序 iht add (int a, int b) {return(a+b);} mian() {int k,(*f)(),a=5,b=10; f=add; … } 则以下函数调用语句错误的是______。

A.k=(*f)(a,b);

B.k=add(a,b);

C.k=*f(a,b);

D.k=f(a,b);

点击查看答案

第5题

有以下程序:#include <iostream>using namespace std;int s=0;class sample{ static int n;publi

有以下程序: #include <iostream> using namespace std; int s=0; class sample { static int n; public: sample (int i) { n=i; } static void add() { s+=n; } }; int sample::n=0;

A.2

B.5

C.7

D.3

点击查看答案

第6题

有以下程序:#include<iostream>using namespace std;class sample{private:int n; public: sampl

有以下程序: #include<iostream> using namespace std; class sample { private: int n; public: sample(){} sample(int m) { n=m; } sample add(sample s1,sample s2) { this->n=s1.n+s2.n; return(*this); }

A.n=10

B.n=5

C.n=20

D.n=15

点击查看答案

第7题

有以下程序:#include <iostream>using namespace std;template < class T >class TAdd{private:

有以下程序: #include <iostream> using namespace std; template < class T > class TAdd { private: T x, y; public: TAdd(T a, T b ) { x = a; y = b; } T add() { return x + y; } }; int main () { TAdd < int > A(5, 6 ); TAdd< double > B(2.4, 5.6 ); cout<<A, add () <<", "<<B. add () <<end1; return 0; } 执行后的输出结果是()。

A.11,8

B.5,6

C.2.4,5.6

D.8,11

点击查看答案

第8题

有以下程序:#include<iostream>using namespace std;class sample{private:int n;public:sample(

有以下程序: #include<iostream> using namespace std; class sample { private: int n; public: sample(){} sample(int m) { n=m; sample add(sample s1,sample s2) { this->n=s1.n+s2.n; return (*this); void disp() cout<<"n="<<n<<end1; } int main() sample s1(10),s2(5),s3; s3.add(s1,s2); s3.disp(); return 0; 程序运行后,输出的结果是

A.n=10

B.n=5

C.n=20

D.n=15

点击查看答案

第9题

有以下程序:#include <iostream>using namespacestd;class sample{private:int n:public:sample

有以下程序: #include <iostream> using namespace std; class sample { private: int n: public: sample () {} sample(int m) { n=m; } sample add(sample s1, sample s2) this->n=s1.n+s2.n; return (*this); } void disp () { cout <<"n="<<n<<end1; } }; int main() sample s1(1)0,s2(5),s3; s3.add(s1,s2); s3.disp(); return 0; } 程序运行后,输出的结果是

A.n=10

B.n=5

C.n=20

D.n=15

点击查看答案

第10题

以下程序的输出结果是______。 include<iostream.h> int add(int x, int y) { return x+y; } doub

以下程序的输出结果是______。

include<iostream.h>

int add(int x, int y)

{

return x+y;

}

double add(double x, double y)

{

return x+y;

}

void main()

{

int a=3, b=3;

double c=6.5, d=1.5;

cout<<add(a, b)<<","<<add(c, d)<<end1;

}

点击查看答案
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
温馨提示
每个试题只能免费做一次,如需多次做题,请购买搜题卡
立即购买
稍后再说
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
赏学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反赏学吧购买须知被冻结。您可在“赏学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
赏学吧
点击打开微信