Pagini recente » Cod sursa (job #2967357) | Cod sursa (job #2273760) | Cod sursa (job #1705896) | Cod sursa (job #2676565) | Cod sursa (job #137003)
Cod sursa(job #137003)
Const fin='grozavesti.in';
fout='grozavesti.out';
nmax=300;
Type cel=Record
L1,C1,L2,C2:integer;
End;
Var
f:text;
A:Array[1..nmax,1..nmax] of LongInt;
i,j,n:integer;
x,min,k:longint;
B:array[1..nmax] of cel;
Begin
assign(f,fin); reset(f);
readln(f,n);
For i:=1 to n do
For j:=1 to n Do
Read(f,a[i,j]);
close(f);
k:=0;
for i:=1 to n-1 do
begin
min:=a[i,i];
for j:=i+1 to n do
if a[j,j]<min then begin
x:=min;
a[j,j]:=min;
min:=x;
k:=k+1;
B[k].L1:=i;
B[k].L2:=j;
B[k].C1:=i;
B[k].C1:=j;
end;
end;
assign(f,fout);rewrite(f);
Writeln(f,k);
For i:=1 to k do
begin
Writeln(f,'C',B[i].C1,' ',B[i].C2);
Writeln(f,'L',B[i].L1,' ',B[i].L2);
end;
close(f);
End.