Cod sursa(job #544865)
Utilizator | Data | 2 martie 2011 12:08:54 | |
---|---|---|---|
Problema | Jocul Flip | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
var mat:array[1..16,1..16] of longint;
n,m,i,j:1..16;
sum:int64;
f:text;
Begin
assign(f,'flip.in');
reset(f);
readln(f,n,m);
for i:=1 to n do begin
for j:= 1 to m do
read(f,mat[i,j]);
readln(f);
end;
close(f);
sum:=0;
for i:=1 to n do
for j:=1 to m do
if mat[i,j]>0 then sum:=sum+mat[i,j];
assign(f,'flip.out');
rewrite(f);
write(f,sum);
close(f);
End.