Pagini recente » Cod sursa (job #1605939) | Cod sursa (job #1241103) | Cod sursa (job #1532285) | Cod sursa (job #855948) | Cod sursa (job #833414)
Cod sursa(job #833414)
var f1, f2:text;
a:array[1..100, 1..100] of integer;
s,i,j,n,m:integer;
begin
assign(f1, 'flip.in');
reset(f1);
readln(f1, n,m);
writeln;
for i:=1 to n do
for j:=1 to m do
read(f1, a[i,j]);
writeln;
for i:=1 to n do
for j:=1 to n do
begin
if a[i,j]<0 then a[i,j]:=a[i,j]*(-1);
s:=s+a[i,j];
end;
assign(f2, 'flip.out');
rewrite(f2);
writeln(f2, s);
close(f2);
end.