91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 29KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-09
  • 語(yǔ)言: C/C++
  • 標(biāo)簽: ecosystem??

資源簡(jiǎn)介

簡(jiǎn)單模擬一個(gè)草原生態(tài)系統(tǒng),保持生態(tài)平衡。包括動(dòng)態(tài)顯示,和統(tǒng)計(jì)一段時(shí)間內(nèi)草,羊,狼,鷹的數(shù)量,并用曲線圖表示。

資源截圖

代碼片段和文件信息


#include?“stdafx.h“
#?include
#?include
#?include
#?include
#?include
#?include
#?include

class?blackground
{
private:
????int?x;
????int?y;
????int?m;
int?n;
????WORD?w;
public:
blackground::blackground(int?x0int?y0int?m0int?n0WORD?w0);???//重載blackground()
????display1();
????display2();
????display3();
????display4();
????display5();
????display6();
display8();
};
blackground::blackground(int?x0int?y0int?m0int?n0WORD?w0)
??? { ?m=m0;
?n=n0;
?y=y0;
?x=x0;
?w=w0;

?????????????SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE)w);
?COORD?pos;
?pos.X=x+m;
?pos.Y=y+n;
?SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE)pos);
}
blackground::display1()
{ ???
?????????printf(“?“);
}
blackground::display2()
{ ???
?????????printf(“兔“);
}
blackground::display3()
{ ???
?????????printf(“羊“);
}
blackground::display4()
{ ???
?????????printf(“鷹“);
}
blackground::display5()
{ ???
?????????printf(“狼“);
}
blackground::display6()
{ ???
?????????printf(“草“);
}
blackground::display8()
{ ???
?????????printf(“*“);
}

///////////定義羊//////////////
class?sheep
{
private:
????int?a;????????????????????????//??數(shù)目
????float?b;???????????????????????//??捕食率
????float?c;???????????????????????//??增長(zhǎng)率
float?d;???????????????????????//??死亡率
????int?s;?????????????????????????//??壽命
int?n;
public:
sheep::sheep1(int?a0float?b0float?c0float?d0int?s0);???//重載blackground()
int?num()
{??n=a*(c-d+1);??
???return?n;
}

};

sheep::sheep1(int?a0float?b0float?c0float?d0int?s0)
??? { ?a=?a0;
?b=?b0;
?c=?c0;
?d=?d0;
?s=?s0;
}

class?wolf
{
private:
????int?a;????????????????????????//??數(shù)目
????float?b2;?????float?b3;????????//??捕食率
????float?c;???????????????????????//??增長(zhǎng)率
float?d;???????????????????????//??死亡率
????int?s;?????????????????????????//??壽命
int?n;
public:
wolf::wolf1(int?a0float?b02float?b03float?c0float?d0int?s0);???//重載blackground()
int?num()
{??n=a*(c-d+1);??
???return?n;
}

};

wolf::wolf1(int?a0float?b02float?b03float?c0float?d0int?s0)
??? { ?a=?a0;
?b2=?b02;??b3=?b03;
?c=?c0;
?d=?d0;
?s=?s0;
}

class?rabbit
{
private:
????int?a;????????????????????????//??數(shù)目
????float?b;???????????????????????//??捕食率
????float?c;???????????????????????//??增長(zhǎng)率
float?d;???????????????????????//??死亡率
????int?s;?????????????????????????//??壽命
int?n;
public:
rabbit::rabbit1(int?a0float?b0float?c0float?d0int?s0);???//重載blackground()
int?num()
{??n=a*(c-d+1);??
???return?n;
}

};

rabbit::rabbit1(int?a0float?b0float?c0float?d0int?s0)
??? { ?a=?a0;
?b=?b0;
?c=?c0;
?d=?d0;
?s=?s0;
}

class?hawk
{
private:
????int?a;????????????????????????//??數(shù)目
????float?b;???????????????????????//??捕食率
????float?c;???????????????????????/

評(píng)論

共有 條評(píng)論

相關(guān)資源