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

Re:PASCAL 1AC

Posted by demaxiya at 2012-08-27 10:32:04 on Problem 2105
In Reply To:PASCAL 1AC Posted by:aiouniya at 2012-08-24 16:04:41
你特马SB看看大神的1AC吧
const
ep:array [1..8] of integer=(1,2,4,8,16,32,64,128);
var
n,i,j,nc,op:integer;
s,p:string;
aa:array [1..8] of integer;
begin
readln(n);
for i:=1 to n do
begin
s:='';
readln(s);
p:=copy(s,1,8);
delete(s,1,8);
for j:=1 to 8 do
aa[8-j+1]:=ord(p[j])-48;
nc:=0;p:='';
for j:=1 to 8 do  nc:=nc+ep[j]*aa[j];
write(nc);
for op:=1 to 3 do
begin
p:=copy(s,1,8);
delete(s,1,8);
for j:=1 to 8 do
aa[8-j+1]:=ord(p[j])-48;
nc:=0;p:='';
for j:=1 to 8 do  nc:=nc+ep[j]*aa[j];
write('.',nc);
end;
writeln;
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