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

那里错了?????

Posted by eric5518 at 2015-04-11 16:16:30 on Problem 1552
var
  a:array[1..16] of byte;
  i,n,j,x,sum:byte;
begin
  read(a[1]);
  while a[1]<>-1 do begin
    n:=2;sum:=0;
    repeat
      read(a[n]);
      inc(n);
    until a[n-1]=0;
    dec(n);
    for i:=1 to n do
      for j:=1 to n do if a[j]=2*a[i] then inc(sum);
    dec(sum);
    writeln(sum);
    read(a[1]);
  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