Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. const max = 100;
  2. var
  3. a:array [1..max,1..max] of integer;
  4. i,j,m,n,min,indexMin: integer;
  5. begin
  6. randomize;
  7. readln(n,m);
  8. for i:= 1 to n do
  9. begin
  10. for j:= 1 to m do
  11. begin
  12. a[i,j]:=random(100);
  13. write(a[i,j]:4);
  14. end;
  15. writeln;
  16.  
  17. end;
  18. min:=a[1,1];
  19. for i:= 1 to n do
  20. begin
  21. for j:= 1 to m do
  22. begin
  23. if a[i,j] < min then
  24. begin
  25. min:=a[i,j];
  26. indexmin:=i;
  27.  
  28. end;
  29.  
  30. end;
  31.  
  32. end;
  33.  
  34. for i:= n downto indexMin do
  35. begin
  36. for j:= 1 to m do
  37. begin
  38. a[i+1,j]:= a[i,j];
  39. end;
  40.  
  41. end;
  42.  
  43. writeln;
  44. writeln;
  45.  
  46.  
  47. for i:= 1 to n+1 do
  48. begin
  49. for j:= 1 to m do
  50. begin
  51. write(a[i,j]:4);
  52. end;
  53. writeln;
  54. end;
  55. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement