可以用遊戲的邏輯去解這題,假設人物是在一個建構好的地圖上移動,移動後踩到區塊就輸出區塊的英文字母。
先建構地圖,將題目給的提示用陣列表示(先不要管空間和編排)
地圖建構:(此時陣列有m行n列,並且人物會移動k次)
int m,n,k;
cin>>m>>n>>k;
char matrix[m][n];
for (int i=0;i<m;i++){
for (int j=0;j<n;j++){
cin>>matrix[i][j];
Are you sure to leave this team?
Once you delete your team, all team notes will be deleted and cannot be recovered. Please ensure you've exported or transfered these notes.
Enter team name before deleting it:
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up