Advertisement
Filip13

dame

Oct 21st, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int x1, y1, x2, y2;
  7. cin >> x1 >> y1 >> x2 >> y2;
  8.  
  9. if ((x1 >= 0 && x1 <= 7) && (x2 >= 0 && x2 <= 7) && (y1 >= 0 && y1 <= 7) && (y2 >= 0 && y2 <= 7)) {
  10.  
  11. if (x1 == x2 || y1 == y2 || (x1 + y1 == x2 + y2) || (abs(x1 - y1) == abs(x2 - y2))) {
  12. cout << "da";
  13. }
  14.  
  15. else {
  16. cout << "ne";
  17. }
  18.  
  19. }
  20. else {
  21. cout << "ne";
  22. }
  23.  
  24.  
  25.  
  26. }
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement