求大神检验代码,只得了80分...

var a,b:array[1..9,1..9] of longint;
    c:array[1..10000] of string;
    i,sum2,j,k,l,n,m,o,q,sum1,sum,p:longint;
begin
     readln(n);
     for i:=1 to n do
      begin
      for j:=1 to 9 do
       for k:=1 to 9 do
        read(a[j,k]);
       readln;
      for l:=1 to 9 do
       sum:=sum+a[l,1];
      for l:=1 to 9 do
       begin
       for m:=1 to 9 do
        sum1:=sum1+a[l,m];
       if sum1<>sum then
        c[i]:='WRONG';
       sum1:=0;
      end;
       for q:=1 to 9 do
       begin
        for o:=1 to 9 do
         sum1:=sum1+a[o,q];
        if sum1<>sum then
         c[i]:='WRONG';
        sum1:=0;
        end;
        for j:=1 to 9 do
         for k:=2 to 9 do                
          if a[j,k]=a[j,1] then
           c[i]:='WRONG';
           while k<=7 do
        begin
         while j<=7 do
          begin
          sum2:=a[k,j]+a[k+1,j]+a[k+2,j]+a[k,j+1]+a[k+1,j+1]+a[k+2,j+1]+a[k,j+2]+a[k+1,j+2]+a[k+2,j+2];
          if sum2<>45 then
           c[i]:='WRONG';
          sum2:=0;
          j:=j+3;
          end;
         k:=k+3;
         j:=1;
         end;

      end;
        for p:=1 to n do
         if c[p]='WRONG' then
          writeln('Wrong')
         else writeln('Right');
end.


1 条评论

  • 1

信息

ID
1335
难度
4
分类
模拟 点击显示
标签
递交数
5130
已通过
1978
通过率
39%
被复制
20
上传者