| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
P1657 这么简单都过不了,唉,哪个大牛给我指点一下我的源程序,样例可过!
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator