i6lan 分享题目的网站
试一试站内搜索 题目类型:问答题

谐音歇后语“钢铃打锣”表示什么
关于雷的歇后语“雷公打芝麻”表
只要采取了辐射防护措施,就可以
有关定密工作小组表述正确的是?
关于雷的歇后语“雷公和土地婆亲

修改以下程序的错误,


#include <iostream.h>

class Test

{int x,y;

public:

fun(int i,int j)

{x=i;y=j;}

show()

{cout<<"x="<<x;

if(y)

cout<<",y="<<y<<endl;

cout<<endl;}

};

void main()

{Test a;

a.fun(1);

a.show();

a.fun(2,4);

a.show();

}


答案:int i,int j调用时,既有一个参数,也有两个参数,且没有重载,所以参数需要带默认值。所以int i,int j错误。[修改]int i,int j=0//注j只要有一个int类型的数据就行。

上一题 下一题

CopyRight©i6lan.com 关于本站
蜀ICP备2021017061号-1

川公网安备 51010402001278号