Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.87 KB | None | 0 0
  1. program bt24;
  2. uses crt;
  3. var A:array[1..1000,1..1000] of integer;
  4.         i,j,k,l,m,n:integer;
  5.         S:int64;
  6.         F,Y:text;
  7. procedure  khaibao;
  8.         Begin
  9.                 clrscr;
  10.                 Assign(F,'D:\69\QUANCO.INP');
  11.                 Assign(Y,'D:\69\QUANCO.OUT');
  12.                 Reset(F);
  13.                 Rewrite(Y);
  14.                 Readln(F,m,n,i,j);
  15.  
  16.                 end;
  17.  
  18. procedure DQ(x,y:integer);
  19. Begin
  20.       If (x<>0) and (y<>0)   then
  21.       If (x<=m) and (Y<=n) then
  22.       Begin
  23.  
  24.         If (x=i) and (y=j) then S:=S+1
  25.         else
  26.                 Begin
  27.                 DQ(x+2,y-1);
  28.                 DQ(x+2,y+1);
  29.                 DQ(x+1,y+2);
  30.                 DQ(x-1,y+2);
  31.                 end;
  32.         end;
  33.       end;
  34.         Begin
  35.         khaibao;
  36.         DQ(1,1);
  37.         Writeln(Y,S);
  38.  
  39.  Readln;
  40.  Close(F);
  41.  Close(Y);
  42.  End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement