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 |
Re:另1条1AC代码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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator