program li;
const c:array[1..8,1..2] of integer=((1,0),(0,1),(-1,0),(0,-1),(1,1),(1,-1),(-1,1),(-1,-1));
var n,m,t,i,j,k,time,temp:longint;
a1:array[1..100,1..100] of char;
a,b:array[1..100,1..100] of integer;
begin
readln(m,n,time);
for i:=1 to n do
begin
for j:=1 to m do begin read(a1[i,j]); a[i,j]:=ord(a1[i,j])-48; end;
readln;
end;
b:=a; t:=1;
while t<time do
begin
inc(t);
b:=a;
for i:=1 to n do
for j:=1 to m do
begin
temp:=0;
for k:=1 to 8 do
if (i+c[k,1]>0) and (i+c[k,1]<=n) and
(j+c[k,2]>0) and (j+c[k,2]<=m) then
if b[i+c[k,1],j+c[k,2]]=1 then inc(temp);
if temp<>3 then a[i,j]:=0;
end;
end;
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j]); writeln;
end;
end.
我还想今晚过90呢。。。。555555555555