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 |
PASCAL代码,水题var i,j,k,n,p:integer; s:string; begin readln(k); for i:=1 to k do begin readln(s); n:=pos(':',s); if n=2 then p:=ord(s[i])-48 else if s[1]='0' then p:=ord(s[2])-48 else p:=(ord(s[1])-48)*10+ord(s[2])-48; if (s[n+1]<>'0') or (s[n+2]<>'0') then writeln(0) else if (p>=0) and (p<=12) then writeln(p+12) else writeln(p-12); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator