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:另1条1AC代码

Posted by demaxiya at 2012-08-29 10:46:17 on Problem 1552
In Reply To:1AC PASCAL Posted by:aiouniya at 2012-08-28 16:52:52
又抢先我一步,真坑爹
var
i,j,n,nb:integer;
a:array [1..100] of integer;
begin
while true do
begin
fillchar(a,sizeof(a),0);
read(a[1]);
if a[1]=-1 then exit;
i:=1;
while a[i]<>0 do
begin
inc(i);
read(a[i]);
end;
n:=i-1;
j:=0;
nb:=0;
for i:=1 to n-1 do
for j:=i+1 to n do
if (a[i]=a[j]*2) or (a[j]=a[i]*2) then inc(nb);
writeln(nb);
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