SHARE
TWEET

penis

LilAsian Jan 15th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program kal;
  2. {$APPTYPE CONSOLE}
  3. uses
  4.   windows,
  5.   sysutils;
  6.  
  7. const
  8.   Nmax=5;
  9.  type matr=array[1..Nmax,1..Nmax] of Integer;
  10.       mass=array[1..Nmax] of Integer;
  11.    var m,n,jj:Byte;
  12.    a,b:matr;
  13.    y1:Boolean;
  14.    dat,res:TextFile;
  15.  procedure vvod(const n,m:Byte;out a:matr; var dat:textfile);
  16.  var i,j:Byte;
  17.   begin
  18.    for i:=1 to n do
  19.    begin
  20.     for j:=1 to m do
  21.      Read(dat,A[i,j]);
  22.     Readln(dat);
  23.     end;
  24.   end;
  25.  procedure prov(const a,b:matr; out jj:byte; const n,m:byte; var y1:boolean);
  26.  var i,j: byte;
  27. begin
  28. y1:=true;
  29.  i:=1;
  30.   while y1 and (i<=n) do
  31.  begin
  32.   j:=1;
  33.    while y1 and (j<=m) do
  34.   begin
  35.     if (a[i,j]<>B[i,j]) then
  36.    begin
  37.     y1:=false;
  38.     jj:=j;
  39.    end;
  40.    Inc(j);
  41.   end;
  42.   inc(i);
  43.  end;
  44. end;
  45.   procedure hui(const jj:Byte; var b:matr; const n,m:byte);
  46. var i:Byte; x:mass;
  47.  begin
  48.    for i:=1 to m do
  49.    x[i]:=b[i,jj];
  50.   for i:=1 to m do
  51.   B[i,jj]:=b[i,m];
  52.   for i:=1 to m do
  53.   b[i,m]:=x[i];
  54.  end;
  55.  procedure out(const a:matr; const n,m:Byte; var res: textfile);
  56.   var i,j:Byte;
  57.   begin
  58.    for i:=1 to n do
  59.    begin
  60.     for j:=1 to m do
  61.      Write(res,A[i,j]:2);
  62.      Writeln(res);
  63.      end;
  64.   end;
  65.   begin
  66.      AssignFile(dat, ParamStr(1));
  67.        Reset(dat);
  68.         AssignFile(res, ParamStr(2));
  69.          Rewrite(res);
  70.       Readln(dat,n);
  71.     Readln(dat,m);
  72.     vvod(n,m,a,dat);
  73.     vvod(n,m,b,dat);
  74.     out(a,n,m,res);
  75.     Writeln(res);
  76.     out(b,n,m,res);
  77.      Writeln(res);
  78.     prov(a,b,jj,m,m,y1);
  79.     if  y1 then
  80.     Writeln(res, 'ravni')
  81.     else
  82.     begin
  83.    hui(jj,b,n,m);
  84.    out(b,n,m,res);
  85.    end;
  86.     close(dat);
  87.   close(res);
  88.   end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top