Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "RUSSIAN");
- // Ход слона
- int x1, x2, y1, y2;
- cout << "Введите x положение фигуры: ";
- cin >> x1;
- cout << "Введите y положение фигуры: ";
- cin >> y1;
- cout << "Введите x положение фигуры куда надо переместиться: ";
- cin >> x2;
- cout << "Введите y положение фигуры куда надо переместиться: ";
- cin >> y2;
- if (abs(x1 - x2) == abs(y1 - y2))
- {
- cout << "Да может";
- }
- else
- {
- cout << "Не может";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement