
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.


Tham Khảo:
#include <bits/stdc++.h>
using namespace std;
bool v(int y, int x) {
return 1 <= y && y <= 8 && 1 <= x && x <= 8;
}
int m(int y, int x, int ty, int tx) {
if (!v(y, x) || !v(ty, tx)) {
return -1;
}
deque<pair<int, pair<int, int>>> q;
q.push_back({y, {x, 0}});
bool vis[9][9] = {false};
vis[y][x] = true;
int dx[] = {-2, -2, 2, 2};
int dy[] = {-2, 2, -2, 2};
while (!q.empty()) {
int cy = q.front().first;
int cx = q.front().second.first;
int s = q.front().second.second;
q.pop_front();
if (cy == ty && cx == tx) {
return s;
}
for (int i = 0; i < 4; ++i) {
int ny = cy + dy[i];
int nx = cx + dx[i];
if (v(ny, nx) && !vis[ny][nx]) {
q.push_back({ny, {nx, s + 1}});
vis[ny][nx] = true;
}
}
}
return -1;
}
int main() {
int y, x, ty, tx;
cin >> y >> x >> ty >> tx;
cout << m(y, x, ty, tx) << endl;
return 0;
}

Mình nghĩ bạn phải có dụng cụ để làm game rồi phần mềm làm game thì sẽ lập trình game được

bạn chỉ cần tải zing mp3 là được mà, thử chưa?
hay là máy không đủ dung lượng để tải?
mình gợi ý thôi nha


b1 :chọn link cần sao chép
b2:Nháy đúp chuột trái vào lệnh copy
b3:Nháy Spaste vào ô em cần đưa dữ liệu cần sao chép tới
-Vậy là xong
Bước 1: Mô đen phần cần sao chép
Buớc 2: Chọn ô em muốn đưa thông tin cần sao chép tới ô đích.
Bước 3: Nhấp chuột phải, chọn lệnh Paste
Mk có ai chơi thì vào nhé https://www.sparkchess.com/
hay lắm kb nha