資源簡介
代碼片段和文件信息
#include?
#include
#include?
#include?
#include?
#include?//時間?//文件
#include?
#define?random(x)(rand()%x)
using?namespace?std;
void?thunder(int?Difint?Rowint?Columnchar?*USer)
{
int?rcalls[22][22]backstage[22][22]={0};
srand((int)time(0));
for(r=1;r<=Row;r++)??????????????????????????????????????//?生成alls(0~1)1是雷
{
for(c=1;c<=Column;c++)
{
if(random(6)<1)??{alls[r][c]=1;}?else{alls[r][c]=0;};
}
};
for(r=0;r<=Row+1;r++)????????????????????????????????//生成?backstage(正確答案)
{
for(int?c=0;c<=Column+1;c++)
{
if(alls[r][c]==1)??
{
backstage[r][c]=(int)(‘*‘);?????????????//將1變?yōu)?*??代表雷
}
else
{
for(int?i=r-1;i<=r+1;i++)?????????????//將0變?yōu)閿?shù)字?(代表周圍雷數(shù))
for(in
- 上一篇:MFC 消息對話框 入門級
- 下一篇:c++ 串口通信程序
評論
共有 條評論