program project1 mode objfpc uses IFDEF UNIX IFDEF UseCThreads cthread

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
program project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
type
ar1=array[1..100,1..100] of integer;
procedure minmax(m,k:integer; var a:ar1);
var j,r:integer;
begin
for j:=1 to m do
begin
r:=a[k,j];
a[k,j]:=a[1,j];
a[1,j]:=r;
end;
end;
var
i,j,n,m,k:integer;
a1:ar1;
begin
readln(n,m);
writeln;
for i:=1 to n do
begin
for j:=1 to m do
begin
read(a1[i,j]);
end;
end;
writeln;
readln(k);
writeln;
minmax(m,k,a1);
for i:=1 to n do
begin
for j:=1 to m do
begin
write(a1[i,j]:2,' ');
end;
writeln;
end;
readln;
readln;
end.