實現掃雷程式
#define _crt_secure_no_warnings
#include
#include
#include
#include
#define max_row 9
#define max_col 9
#define mine_count 10
intmenu()
void
init
(char showmap[max_row]
[max_col]
,char minemap[max_row]
[max_col]
) minemap[row]
[col]
='1'
; count--;}
}void
print
(char showmap[max_row]
[max_col]
)printf
("\n");
printf
("---+---------------------\n");
for(
int row =
0; row < max_row; row++
)printf
("\n");
}}void
input
(char showmap[max_row]
[max_col]
,int
* row,
int* col)
if(showmap[
*row]
[*col]
!='*'
)break;}
}int
checkmine
(char minemap[max_col]
[max_col]
,int row,
int col)
return0;
}int
checklastblank
(int
* count)
return0;
}void
update
(char shpwmap[max_row]
[max_col]
,char minemap[max_row]
[max_col]
,int row,
int col)
if(r == row&&c == col)
if(minemap[r]
[c]==
'1')}}
shpwmap[row]
[col]
= count+
'0';
}void
game()
;char minemap[max_row]
[max_col]=;
int count =0;
init
(showmap, minemap)
;while(1
)//5.檢查當前位置是否是最後乙個位置,如果是,則遊戲勝利if(
checklastblank
(&count)
)//6.更新翻開的當前位置,把*替換成乙個數字
第四節 陣列(一)
實現三子棋程式 define crt secure no warnings include include include include intmenu define max row 3 define max col 3 void init char chessboard max row max ...
第四節 資料降維案列
import pandas as pd from sklearn.decomposition import pca 讀取表 prior pd.read csv r e 360downloads software 降維案列資料 order products prior.csv products pd....
ObjC第四節 繼承
繼 承 1 繼承 1.1 nsobject,根類,oc建立的類都繼承自根類,位於類層次結構的頂層,沒有父類 1.2 父類的例項變數和方法都可以被隱式的繼承過來成為子類的一部分,子類就可以直接訪問這些例項變數和方法 1.3 alloc和init是繼承自nsobject的方法 1.4 繼承的概念呈單鏈繼...