Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

P1657 这么简单都过不了,唉,哪个大牛给我指点一下

Posted by ufox at 2006-02-28 20:14:10
我的源程序,样例可过!
program P1657;
var
   n,i,a,b,xx:integer;
   QiShi,MuBiao:string;
begin
     readln(n);
     for i:=1 to n do
     begin
          readln(mubiao);
          xx:=pos(' ',mubiao);
          qishi:=copy(mubiao,1,xx-1);
          delete(mubiao,1,xx);
          a:=abs(ord(mubiao[1])-ord(qishi[1]));
          b:=abs(ord(mubiao[2])-ord(qishi[2]));
          if a>b then write(a,' ') else write(b,' ');
          if a=b then write(1,' ') else
          write(ord(not(a=0))+ord(not(b=0)),' ');
          write(ord(not(a=0))+ord(not(b=0)),' ');
          if a=b then writeln(1) else
          if (a+b) mod 2=0 then writeln(2) else
          writeln('Inf');
     end;
end.

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator