Advertisement
esvikey

zad2_dvumern

Apr 11th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.61 KB | None | 0 0
  1. uses crt;
  2. const n=3;
  3. var a: array[1..n,1..n] of integer; i,j:integer; min:integer;
  4. begin
  5. writeln('Задайте массив: ');
  6. for i:=1 to n do
  7. for j:=1 to n do
  8. readln(a[i,j]);
  9. clrscr;
  10. min:=a[1,1];  
  11. writeln('Начальный массив ');
  12. for i:=1 to n do
  13. for j:=1 to n do begin
  14. write(a[i][j]:4);
  15. if j=n then writeln();
  16. end;
  17. for i:=1 to n do
  18. for j:=1 to n do
  19. if a[i,j]<min then min:=a[i,j];
  20. writeln();
  21. writeln('Конечный массив ');
  22. for i:=1 to n do
  23. for j:=1 to n do
  24. begin
  25. if a[i,j]=0 then a[i,j]:=min;
  26. write(a[i][j]:4);
  27. if j=n then writeln();
  28. end;
  29. writeln();
  30. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement