这个程序输出来的为什么是随机数啊?#include using namespace std;class father{private:int fatherweight,fathertall;public:void setfathertall(int fathertall){fathertall=fathertall;}void setfatherweight(int fatherweight){fatherweight=fat

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 08:33:13

这个程序输出来的为什么是随机数啊?#include using namespace std;class father{private:int fatherweight,fathertall;public:void setfathertall(int fathertall){fathertall=fathertall;}void setfatherweight(int fatherweight){fatherweight=fat
这个程序输出来的为什么是随机数啊?
#include
using namespace std;
class father
{
private:
int fatherweight,fathertall;
public:
void setfathertall(int fathertall){fathertall=fathertall;}
void setfatherweight(int fatherweight){fatherweight=fatherweight;}
void printfathertallweight(){cout

这个程序输出来的为什么是随机数啊?#include using namespace std;class father{private:int fatherweight,fathertall;public:void setfathertall(int fathertall){fathertall=fathertall;}void setfatherweight(int fatherweight){fatherweight=fat
你的形参名和成员变量名相同,系统也会搞混的
void setfathertall(int fathertall){fathertall=fathertall;}
//比如 fathertall=fathertall 你自己能分辨吗?
#include
using namespace std;
class father
{
private:
int fatherweight,fathertall;
public:
void setfathertall(int tall){fathertall=tall;}
void setfatherweight(int weight){fatherweight=weight;}
void printfathertallweight(){cout