var
n,h,i,j:integer;
m:array[1..10,1..10] of char;
ocr:string;
begin
ocr:=;
readln(n,h);
for i:=1 to n do
begin
for j:=1 to h do
read(m[i,j]);
readln();
end;
for i:=2 to n-1 do
for j:=2 to h-1 do
if(m[i,j]=0)then
begin
if((m[i-1,j-1]=1)and(m[i,j-1]=1)and(m[i-1,j]=1))then
ocr:=ocr+1;
if((m[i-1,j+1]=1)and(m[i,j+1]=1)and(m[i-1,j]=1))then
ocr:=ocr+2;
if((m[i+1,j-1]=1)and(m[i,j-1]=1)and(m[i+1,j]=1))then
ocr:=ocr+3;
if((m[i+1,j+1]=1)and(m[i,j+1]=1)and(m[i+1,j]=1))then
ocr:=ocr+4;
end;
if(ocr=)then
writeln(1);
if(ocr=2413)then
writeln(2);
if(ocr=2424)then
writeln(3);
if((ocr=342)or(ocr=34321))then
writeln(4);
if(ocr=1324)then
writeln(5);
if(ocr=131234)then
writeln(6);
if(ocr=2)then
writeln(7);
if(ocr=12341234)then
writeln(8);
if(ocr=123424)then
writeln(9);
if(ocr=1234)then
writeln(0);
end.
http://www.rqnoj.cn/Status_Show.asp?SID=62984
我貌似情况没考虑全面...
60分..
是不是有几组笔画不太一样的。。