Advertisement
Guest User

kod

a guest
Oct 25th, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.91 KB | None | 0 0
  1. const n=3;m=4;
  2. type mas=array[1..n,1..m] of integer;
  3. var z,v,g:mas; f2:text;
  4.  
  5. procedure vv(var a,b,c:mas);
  6. var i,j:integer;
  7. begin
  8. assign(f2,'laba6.txt');
  9. reset(f2);
  10. for i:=1 to n do
  11. begin
  12. for j:=1 to m do
  13. readln(f2,a[i,j]);
  14. readln(f2);
  15. end;
  16. readln(f2);
  17. for i:=1 to n do
  18. begin
  19. for j:=1 to m do
  20. readln(f2,b[i,j]);
  21. readln(f2);
  22.  
  23. end;
  24. readln(f2);
  25. for i:=1 to n do
  26. begin
  27. for j:=1 to m do
  28. readln(f2,c[i,j]);
  29. readln(f2);
  30.  
  31. end;
  32. end;
  33. function od(x:mas):boolean;
  34. var i,j,ii,jj:integer;
  35. f:boolean;
  36. begin
  37. f:=false;
  38. ii:=1;
  39. while (ii<=n)and(not f) do
  40. begin
  41. jj:=1;
  42. while (jj<=m)and(not f) do
  43. begin
  44. i:=1;
  45. while (i<=n) do
  46. begin
  47. j:=1;
  48. while (j<=m) do
  49. begin
  50. if (x[ii,jj]=x[i,j])and((ii<>i)and(jj<>1)) then f:=true;
  51. inc(j)
  52. end;
  53. inc(i)
  54. end;
  55. inc(jj)
  56. end;
  57. inc(ii)
  58. end;
  59. od:=f
  60. end;
  61.  
  62. begin
  63. vv(z,v,g);
  64. append(f2);
  65. writeln(f2,od(z));
  66.  
  67. writeln(f2,od(v));
  68.  
  69. writeln(f2,od(g));
  70. close(f2);
  71. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement