#8900: Pascal求救(WA;line7)


lswei (魏子轩)


var
  a:array[1..81]of byte;
  b,z,h,s,i,j,k,l:integer;
  ss:boolean;
begin
  while not eof do begin
   b:=b+1;
   if b<>7 then begin
   z:=0;
   h:=0;
   s:=0;
   ss:=true;
   for i:=1 to 81 do read(a[i]);
   for i:=1 to 9 do begin
    for j:=1 to 9 do z:=z+a[(i-1)*9+j];
    if z<>45 then ss:=false;
    z:=0;
   end;
   for i:=1 to 9 do begin
    for j:=1 to 9 do h:=h+a[(i-1)*9+j];
    if h<>45 then ss:=false;
    h:=0;
   end;
   for i:=1 to 3 do begin
    for j:=1 to 3 do begin
     for k:=1 to 3 do begin
      for l:=1 to 3 do s:=s+a[(i*3-3)*9+(k-1)*9+l];
     end;
    if s<>45 then ss:=false;
    s:=0;
    end;
   end;
   if ss then writeln('yes')
         else writeln('no');
  end;
  end;
end.
#8901: Re:Pascal求救(WA;line7)


lswei (魏子轩)


請把代碼裡的 b 无视