Advertisement
eggggggggor

ferzUgrozhaet

May 26th, 2024 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.46 KB | None | 0 0
  1. program ferz;
  2.  
  3. var
  4.   k, l, m, n: integer;
  5.  
  6. begin
  7.   writeln('Введите координаты ферзя (k l):');
  8.   readln(k, l);
  9.   writeln('Введите координаты клетки (m n):');
  10.   readln(m, n);
  11.  
  12.   if (k = m) or (l = n) or (abs(k - m) = abs(l - n)) then
  13.     writeln('Ферзь угрожает клетке (', m, ', ', n, ')')
  14.   else
  15.     writeln('Ферзь не угрожает клетке (', m, ', ', n, ')');
  16. end.
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement