Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 70 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. uses crt;
  2. var
  3. a:array [1..10,1..10] of integer;
  4. temp,min,max,i,j:integer;
  5. n,m,min_i,max_i:byte;
  6. begin
  7. clrscr;
  8. randomize;
  9.  
  10.  
  11. writeln('vvedite kol-vo strok(n) matrici:');
  12. readln(n);
  13. writeln('vvedite kol-vo stolbcov(m) matrici:');
  14. readln(m);
  15.  
  16. writeln('vvedite matricy:');
  17. for i:= 1 to n do begin
  18. writeln('stroka ',i);
  19. for j:= 1 to m do
  20. read(a[i,j]);
  21. end;
  22.  
  23.  
  24. writeln('default matrix:');
  25. for i:= 1 to n do begin
  26. writeln;
  27. for j:= 1 to m do
  28. write(a[i,j]:5);
  29. end;
  30. writeln;
  31.  
  32. min:=a[1,1];
  33. max:=a[1,1];
  34. for i:= 1 to n do
  35. for j:= 1 to m do
  36. begin
  37. if a[i,j] > max then begin max:=a[i,j]; max_i:=i; end;
  38. if a[i,j] < min then begin min:=a[i,j]; min_i:=i; end;
  39. end;
  40.  
  41. for j:= 1 to m do
  42. begin
  43. temp:=a[min_i,j];
  44. a[min_i,j]:=a[max_i,j];
  45. a[max_i,j]:=temp;
  46. writeln('lol');
  47. end;
  48.  
  49. writeln('obrabotana9 matrix:');
  50. for i:= 1 to n do begin
  51. writeln;
  52. for j:= 1 to m do
  53. write(a[i,j]:5);
  54. end;
  55. writeln;
  56.  
  57. 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
 
Top