c++编程 补充程序题
来源:百度知道 编辑:UC知道 时间:2024/05/14 19:11:01
1. 在下划线处填上正确的语句成分,并编写一个测试主程序。10分
#include<iostream.h>
class Test
{
public :
Test(int a,int b){ ___(1)______ }
void show( ){ ____(2)_____ }
private :
int x,y;
};
记得测试程序也得写上 谢谢 考试急用
没什么 知道就做下
#include<iostream.h>
class Test
{
public :
Test(int a,int b){ ___(1)______ }
void show( ){ ____(2)_____ }
private :
int x,y;
};
记得测试程序也得写上 谢谢 考试急用
没什么 知道就做下
如果你不要求程序有特殊功能的话,一般这样写:
(1)
x=a;
y=b;
(2)
cout<<"("<<x<<","<<y<<")"<<endl;
测试函数
int main()
{
int a,b;
cout<<"输入两个整数:";
cin>>a>>b;
Test t(a,b);
t.show();
return 0;
}
想干什么啊??