|
|
back to boardTHAT EASY(PASCAL) program p1197; var st:string; n,i:byte; procedure sort1; begin if (st[2]='1') or (st[2]='8') then begin writeln(2); exit; end; if (st[2]='2') or (st[2]='7') then begin writeln(3); exit; end; writeln(4); exit; end; procedure sort2; begin if (st[2]='1') or (st[2]='8') then begin writeln(3); exit; end; if (st[2]='2') or (st[2]='7') then begin writeln(4); exit; end; writeln(6); exit; end; procedure sort3; begin if (st[2]='1') or (st[2]='8') then begin writeln(4); exit; end; if (st[2]='2') or (st[2]='7') then begin writeln(6); exit; end; writeln(8); exit; end; begin readln(n); for i:=1 to n do begin readln(st); if (st[1]='a') or (st[1]='h') then begin sort1; end; if (st[1]='b') or (st[1]='g') then begin sort2; end; if (st[1]='c') or (st[1]='d') or (st[1]='e') or (st[1]='f') then begin sort3; end; end; end. |
|
|