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.
Exercise 3. Chia động từ cho các câu sau đây.
1. My tutor (see) ………………………… me for a tutorial every Monday at 5 p.m.
2. My brother (not/study) ………………………… very hard at the moment. I (not/think) ………………………… he’ll pass his tests.
3. Young people (take) ………………………… up traditional style hobbies such as knitting and walking in the countryside as of lately.
4. In my country, we (drive) ………………………… on the left-hand side of the road.
5. My parents (travel) ………………………… around the world this summer, and probably won’t be back for a couple of months.
6. The number of wild butterflies (fall) ………………………… dramatically as a result of changes in farming methods.
7. More people (play) ………………………… sports on a regular basis nowadays.
8. I have never thought of studying abroad before. I (not/leave) ………………………… Vietnam anytime soon.
9. Nowadays, people (use) ………………………… the gym or a climbing wall as their way of sporting recreation.
10. The number of web users who shop online (increase) ………………………… due to the convenience of the Internet.
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;
}
Somebody help me pls
Đoạn mã để thực hiện công việc trên bằng ngôn ngữ C++ như sau: