- 数独验证
- 2015-07-12 10:59:54 @
var
i,n:longint;
g:array[1..20]of string;
procedure pd(m:longint);
var
p:array[1..9,1..9,1..9]of boolean;
q:array[1..9]of boolean;
a:array[1..9,1..9]of longint;
i,j,k,l:longint;
begin
fillchar(q,sizeof(q),true);
fillchar(p,sizeof(p),true);
for i:=1 to 9 do
begin
for j:=1 to 9 do
begin
read(a[i,j]);
if p[i,j,a[i,j]]=false then
begin
g[m]:='wrong';
exit;
end else p[i,j,a[i,j]]:=false;
end;
end;
for i:=1 to 9 do
begin
if i mod 3=1 then
begin
for j:=1 to 9 do
begin
if j mod 3=1 then
begin
for k:=i to i+2 do
begin
for l:=j to j+2 do
begin
if q[a[k,l]]=false then
begin
g[m]:='wrong';
exit;
end else q[a[k,l]]:=false;
end;
end;
fillchar(q,sizeof(q),true);
end;
end;
end;
end;
end;
begin
readln(n);
for i:=1 to n do g[i]:='right';
for i:=1 to n do pd(i);
for i:=1 to n-1 do
begin
write(g[i]);
writeln;
end;
write(g[n]);
end.
为毛一个点都没过
2 条评论
-
方晨羽 LV 9 @ 2016-08-13 14:12:17
有大问题!!!致命
-
2015-07-12 11:03:25@
好吧又是大小写
但第四个点什么情况
- 1