讨论 / 大牛!!!帮忙指点一下!数字识别问题
Anyone_1 2008-08-16 01:59:00
点我顶贴 收藏 删除
const ans:array[0..9]of string

=(

’1234’,

’’,

’2413’,

’2424’,

’342’,

’’,

’131234’,

’12’,

’12341234’,

’123424’

);

var s:string;

c:char;

i,j,k,n,m:integer;

g:array[0..10,0..10]of integer;

begin

readln(n,m);

for i:=1 to n do

begin

for j:=1 to m do

begin

read(c);

g[i][j]:=ord(c)-48;

end;

readln;

end;

for i:=1 to n do

for j:=1 to m do

if g[i][j]=0 then

begin

if(g[i-1][j]=1)and(g[i][j-1]=1) then s:=s+’1’;

if(g[i-1][j]=1)and(g[i][j+1]=1) then s:=s+’2’;

if(g[i][j-1]=1)and(g[i+1][j]=1) then s:=s+’3’;

if(g[i][j+1]=1)and(g[i+1][j]=1) then s:=s+’4’;

end;

if length(s)<=1 then write(1) else begin

for i:=0 to 9 do if s=ans[i] then begin write(i);k:=1;break;end;

if k=0 then begin

j:=0;

for i:=1 to n do inc(j,g[i][1]);

if (s=’1324’)and(j=n)then write(0);

if s=’131324’ then write(6);

if s=’13241324’ then write(8);

if s=’132424’ then write(9);

end;

end;

end.

题目编号:206-数字识别 查看该题

状态: Unaccepted

测评机: Xeond[6]

得分: 80分

提交日期: 2008-8-16 15:57:00

有效耗时: 407毫秒

测试结果1: 通过本测试点|有效耗时62:ms

测试结果2: 测试结果错误.错误结果为:1

正确结果应为:7

测试结果3: 测试结果错误.错误结果为:1

正确结果应为:0

测试结果4: 通过本测试点|有效耗时47:ms

测试结果5: 通过本测试点|有效耗时47:ms

测试结果6: 通过本测试点|有效耗时47:ms

测试结果7: 通过本测试点|有效耗时47:ms

测试结果8: 通过本测试点|有效耗时47:ms

测试结果9: 通过本测试点|有效耗时63:ms

测试结果10: 通过本测试点|有效耗时47:ms

老是WA 第2 3个点

我现在都要晕了

计算器都被我摁衰了

#1 Anyone_1@2008-08-16 01:16:00
回复 删除
7的问题解决了,接下来是0的问题
#2 Anyone_1@2008-08-16 01:59:00
回复 删除
哦 我懂了

会有这种数据吧?(猜测)

4 5

11111

10001

11111

00000

这是0

我的程序测得5

稍作修改就可以了

还有,我要买一个新的计算器!!!^v~

查看更多回复
提交回复