作业帮 > 综合 > 作业

C++程序分析 请解释的清楚一些

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/09/13 07:54:27
C++程序分析 请解释的清楚一些
#include
#include
#include
class Dice{
private:
static int count;
int a,b;
public:
void init(int x,int y)
{
a=x;
b=y;
count++;
return ;
}
int getdice1()
{
return a;
}
int getdice2()
{
return b;
}
int Getpoint()//骰子的点数
{
return a+b;
}
void print()//输出掷骰子的结果
{
cout
#include
#include
#include
class Dice{ //dice类.
private:
static int count; //计数器,静态
int a,b;
public:
void init(int x,int y) //初始化类
{
a=x;
b=y;
count++;
return ;
}
int getdice1() //返回类中变量a的值
{
return a;
}
int getdice2() //返回类中变量b的值
{
return b;
}
int Getpoint()//骰子的点数
{
return a+b;
}
void print()//输出掷骰子的结果
{
cout