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

NeedHelp 2105

Posted by xt at 2005-06-25 14:20:05 on Problem 2105
program pku2105;
var
  n,p,i:integer;
  s:string;
function c2n(x:char):byte;
begin
  c2n:=ord(x)-48;
end;
begin
  readln(n);
  for i:=1 to n do begin
    readln(s);
    p:=c2n(s[1])*128+c2n(s[2])*64+c2n(s[3])*32+c2n(s[4])*16+c2n(s[5])*8+c2n(s[6])*4+c2n(s[7])*2+c2n(s[8])*1;
    write(p,'.');
    p:=c2n(s[9])*128+c2n(s[10])*64+c2n(s[11])*32+c2n(s[12])*16+c2n(s[13])*8+c2n(s[14])*4+c2n(s[15])*2+c2n(s[16])*1;
    write(p,'.');
    p:=c2n(s[17])*128+c2n(s[18])*64+c2n(s[19])*32+c2n(s[20])*16+c2n(s[21])*8+c2n(s[22])*4+c2n(s[23])*2+c2n(s[24])*1;
    write(p,'.');
    p:=c2n(s[25])*128+c2n(s[26])*64+c2n(s[27])*32+c2n(s[28])*16+c2n(s[29])*8+c2n(s[30])*4+c2n(s[21])*2+c2n(s[32])*1;
    writeln(p);
  end;
end.

Why WA

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